Tagged: , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5212
    xray
    Member

    Please enable displaying of pages in the posts slider (by setting a page id in the admin interface). It is really easy to do, you just have to add one line in catcheverest-functions.php (function catcheverest_post_sliders):

    ‘posts_per_page’ => $options[ ‘slider_qty’ ],
    ‘post_type’ => array( ‘post’, ‘page’ ), // new line to enable pages
    ‘post__in’ => $options[ ‘featured_slider’ ],
    ‘orderby’ => ‘post__in’,
    ‘ignore_sticky_posts’ => 1 // ignore sticky posts

    Thank you!

    To do this change in a child theme is a real pain! You need your own catcheverest_post_sliders()-function (obviously) and your own catcheverest_slider_display()-function calling your own catcheverest_post_sliders() function. And then you need a third function which unhooks the old catcheverest_slider_display()-function and adds your customized one. This function needs to be hooked to the ‘init’-action then. (All this can be done in functions.php of the child theme.)

    Greetz,
    xray

    #5302
    Sakin
    Keymaster

    @xray: Great. Yes you are right.

    #5903
    mrt_rl
    Member

    @xray is this working now? today i tried to add pages to the slider. although i set the featured image and everything, but nothing was displayed. tried it for 3 pages got the same result in all. it would be great if pages can be shown in slider 🙂

    #5924
    xray
    Member

    @mrt_rl no it’s not working in Catch Everest v0.1.3. You need to patch the theme yourself as described in the first post (edit function catcheverest_post_sliders() in inc/catcheverest-functions.php), or better make a child theme for this patch, so it won’t be lost on theme update.

    See http://codex.wordpress.org/Child_Themes on how to make a child theme. Copy this code into the functions.php of your child theme: http://pastebin.com/Bgy75VuG

    BTW: This forum is really really crappy.

    #5955
    mrt_rl
    Member

    @xray thanks for the reply i’ll give it a try!

    #10430
    mfztsrw2
    Member

    Thanks xray – this looks like it’s just what I need. I’ve created my child theme and pasted this your content into my child functions.php file, just as is. But it doesn’t work for me. Is it just because I’ve got Catch Everest v1.1 – just wondering if I should persevere, or if things have changed so this no longer works since the update to 1.1?

    #11101
    nesciens
    Member

    In version 1.1.2, the definition of catcheverest_post_sliders is wrapped in “if ( ! function_exists( ‘catcheverest_post_sliders’ ) )”, so you can replace it by your own function in a child theme.

    That is, just copy that function to your child’s functions.php and add in the extra line from the original post. (I added the slightly different line “‘post_type’ => ‘any’,”, so that a custom post type from a plugin also works.)

    Would be nice to have that line in the next version though.

    #11143
    Sakin
    Keymaster

    @nesciens: That’s nice. Yes, you can simply build child theme and add it like you have done it.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Allow pages for posts slider (and workarounds)’ is closed to new replies.