How to know page ID to show specific pages in home page slider?

  • raindance

    #1612

    Let’s say I have 5 pages I want featured in the home page slider. Pages rather than posts.

    I don’t know how to tell it which pages to show?

    I get it that if they were posts, I’d just assign them to a category. But I want these to be pages not posts. I see that I would choose the “show specific pages/posts” in the slider dashboard panel, but then it says to enter the id/number of the specific pages…where do I see what the id number is of the specific pages I want to show?

    It would be great if pages could be assigned to a category like posts then I could more easily set them to show as they will change frequently, rather than have to find an id number then change the id numbers in that panel every time.

    What’s the best way to manage frequently changing pages for the home page slider…is finding/entering the id number the only way?

    And again please let me know how I see the id number of the pages to enter in.

    Thanks so much in advance!

    raindance

    #16509

    I just added a plug in called “simply show ids”. There is also one called “reveal ids for wp admin”. Now I can see the ids in the main pages table. By the way I couldn’t see it in the url because I’d changed the permalinks structure to be the name of the post.

    But my question remains..is there an easier way than having to regularly update the slider control panel with the right ids for pages? I’d love for it to be more like posts where I could assign them to a category like “home page slider” easily.

    Thanks again.

    Admin

    Syahir Hakim

    #16510

    Two steps. First, install this plugin which will allow you to assign categories to pages: http://wordpress.org/extend/plugins/map-categories-to-pages/

    Then, add this code into your child theme’s functions.php file:

    <?php
    function graphene_slider_post_types(){
    return array('post', 'page');
    }
    add_filter( 'graphene_slider_post_type', 'graphene_slider_post_types' );
    ?>

    raindance

    #16511

    Ok installed the plug in.

    But not sure what you mean by “add this code into your child theme’s functions.php fil”

    I’m just using Grahpene…not sure I understand the whole child theme theory.

    So..just add it into the main functions.php file?

    Does it have to be in any particular place in the file/

    Thanks!

    raindance

    #16512

    I added it to the end of the functions.php file and got all kinds of errors (which I should have copied and pasted but didn’t).

    Took it out and seems ok again. So clearly I put it in the wrong place.

    Would you please tell me exactly where to put the code: (given that I don’t know what you mean by child theme functions file)

    <?php

    function graphene_slider_post_types(){

    return array(‘post’, ‘page’);

    }

    add_filter( ‘graphene_slider_post_type’, ‘graphene_slider_post_types’ );

    ?>

    I do see that now that the plug in is installed I can assign pages to categories…and have done so for home page slider pages…awesome, thanks for that.

    Just need clarification on where to post the above code.

    Thanks

    Mod

    Kenneth John Odle

    #16513

    You really need to know what a child theme is. Here is information from this forum, and here is some information from the WordPress Codex.

    This will help you out immensely, believe me.

    Ken

    raindance

    #16514

    Ok so child theme is installed.

    Installed Map Pages to Categories plug in.

    Added

    <?php

    function graphene_slider_post_types(){

    return array(‘post’, ‘page’);

    }

    add_filter( ‘graphene_slider_post_type’, ‘graphene_slider_post_types’ );

    ?>

    To the child theme functions page.

    In the dashboard > Settings > Map Pages to Categories I checked that first box

    Show the Pages on Category pages

    But not checked the second one about posts.

    Now I can assign pages to my “home page slider” category and they show up there.

    THANK YOU! Perfect!

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

You must be logged in to reply to this topic.