- This topic has 7 replies, 5 voices, and was last updated 11 years, 5 months ago by Sakin.
-
AuthorPosts
-
March 15, 2013 at 12:43 pm #5212xrayMember
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 postsThank 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,
xrayMarch 17, 2013 at 10:43 pm #5302March 26, 2013 at 8:57 pm #5903mrt_rlMember@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 🙂
March 26, 2013 at 11:47 pm #5924xrayMember@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.
March 27, 2013 at 3:47 pm #5955June 13, 2013 at 10:37 pm #10430mfztsrw2MemberThanks 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?
June 27, 2013 at 4:53 am #11101nesciensMemberIn 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.
June 28, 2013 at 12:04 am #11143 -
AuthorPosts
- The topic ‘Allow pages for posts slider (and workarounds)’ is closed to new replies.