Community Forums › Forums › Archived Forums › Design Tips and Tricks › Responsive slider working with multiple post types?
Tagged: responsive slider
- This topic has 4 replies, 3 voices, and was last updated 13 years ago by
Smaele.
-
AuthorPosts
-
January 27, 2013 at 11:33 am #15342
Smaele
MemberI use Genesis with a modified version of the Agency theme and the responsive slider. I also use a custom post type. I'd like to be able to use posts, pages and my custom post type in the responsive slider.
To do this I tweaked the function 'genesis_responsive_slider_options_box' in admin.php by adding the following code:
array_push ($post_types, 'any');
natsort ($post_types);This gives the extra 'any' post type to select from in the dropdown box of the admin panel (responsive slider settings) and all seems to work well.
My question: Is it possible to add this any option in the standard Responsive Slider? Or does it have unwanted side effects?
February 1, 2013 at 6:46 pm #17283SoZo
MemberSorry, I don't quite follow. You say you edited the slider and it's working but then ask if you can edit the slider? Confused 😉
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 2, 2013 at 12:32 am #17313Smaele
MemberHi, sorry for the confusion. I did manage to change the original code of the responsive slider as described. With this change it is now possible to mix different post types (page, post en custom post types) in the slider. But having changed the original code of the responsive slider will give issues once new updates are available. So, my question actually is for StudioPress to see if it is possible to make this change to the original responsive slider.
March 5, 2013 at 11:58 pm #24488dianearmitage
MemberHi Smaele,
I'm simply wanting to know how we can be able to include a featured image in the slider with either a Post or a Page featured image. I think this is what you're trying to accomplish and if so, you should be able to modify the Function.php file under Appearance / "Edit" in your child theme.
Let me know if you have a clear solution and thanks for your input so far!
Michael
March 6, 2013 at 12:31 pm #24574Smaele
MemberIf I understand you correctly you'd like to know how I solved the question "how to add posts and pages in the genesis slider?".
I tweaked function "genesis_responsive_slider_options_box" in the admin.php file of the genesis responsive slider by adding two lines of code, see: /*tweaked*/:
....
$post_types = array_filter( $post_types, 'genesis_responsive_slider_exclude_post_types' );
array_push ($post_types, 'any'); /* tweaked */
natsort ($post_types);Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â /* tweaked */foreach ( $post_types as $post_type ) { ?>
...This solution gives you the "any" option in the admin panel. Of course the downside of this 'solution' is it will be overwritten when a new version of the slider is installed.
Hope this answers your question.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.