Responsive slider working with multiple post types?

Community Forums Forums Design Tips and Tricks Responsive slider working with multiple post types?

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Smaele 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #15342

    Smaele
    Participant
    Post count: 3

    I 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?

    • This topic was modified 1 year, 6 months ago by  Susan.
    • This topic was modified 1 year, 6 months ago by  Susan.
    #17283

    SoZo
    Moderator
    Post count: 1573

    Sorry, 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

    #17313

    Smaele
    Participant
    Post count: 3

    Hi, 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.

     

     

    #24488

    dianearmitage
    Participant
    Post count: 3

    Hi 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

    #24574

    Smaele
    Participant
    Post count: 3

    If 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.

     

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.