WordPress.org

Ready to get started?Download WordPress

Forums

List Pages Shortcode
[resolved] Remove home from children list (17 posts)

  1. paljasken
    Member
    Posted 2 years ago #

    Listing the child-pages works just fine for me but a link tot Home appears on every single page. Can I somehow get rid of it?
    I don't have a page set as a homepage, it is created by the theme that I'm using that shows some featured boxes on the homepage.

    http://wordpress.org/extend/plugins/list-pages-shortcode/

  2. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    You can exclude page IDs using:
    [child-pages exclude="675"]

  3. zoltandragon
    Member
    Posted 1 year ago #

    Ben, what is the ID for the "Home" page? 1? 0? does it have an ID at all?

  4. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    The ID is a number value associated with a page or post.

    When editing a page you will see it in the address bar, for example the the following URL show the page ID is 675:
    http://example.com/wp-admin/post.php?post=675&action=edit

    Or, you can install a plugin like Simply Show IDs which will show you the IDs in a column when showing you all the pages in the admin.
    http://example.com/extend/plugins/simply-show-ids/

  5. zoltandragon
    Member
    Posted 1 year ago #

    Ben, I understand that - but what is the ID for Home? It is not a post/page the user creates, I guess ;)

  6. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, if you are using your site with the home page showing all posts it doesn't exist as a page. In which case, the home page should not be included in the output.

    If you have set a home page in your Settings > Reading options in the admin, then the home page will be the page you selected there.

    Can you confirm if in your Settings > Reading options you have it set to "Your latest posts" or "Use a static page"?

  7. zoltandragon
    Member
    Posted 1 year ago #

    It is the "Your latest posts" option - that is why I keep on asking about it, otherwise it is crystall clear why we would need an ID for Home (so I do not intend to troll or spam the your forum :D)

  8. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    So is there a Home link appear in the top of your list like the original question at the top of this thread?

    Just trying to help ;)

  9. zoltandragon
    Member
    Posted 1 year ago #

    Exactly, yes. (And thank you for your efforts to help us out, btw)

  10. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    In my testing no home link is added.
    It could possibly be your theme or a plugin that is adding it automatically?

    If you flip to the default WordPress theme do you still have the issue?

    If the Home link still gets added with the default theme, try disabling all other plugins and see if that fixes it. If if does, reactivate each plugin one by one to determine which one is causing the issue, then let me know so I can look into it.

  11. paljasken
    Member
    Posted 1 year ago #

    Hi Ben,

    Thank you very much for looking in to this. As you suggested this is a problem related to my theme. Because when activating another theme there's no home.

    My theme creates a custom homepage with items that are entered in the appearance settings in admin. This is not an actual page, so it does not have a number.

    I guess I have to learn to live with it or choose a different theme.

  12. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    Which theme is it? - it might be possible to fix with a workaround.

  13. paljasken
    Member
    Posted 1 year ago #

    The Theme is ToomMorel Pro by inkthemes
    http://www.inkthemes.com/

  14. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    It's a paid-for theme.

    Would you be willing to provide with with the theme files or access to your admin to investigate further?

    Contact me via my website and I'll let you know my email address to send the files to.

  15. zoltandragon
    Member
    Posted 1 year ago #

    Ben, I also have an InkTheme - the freely available Blackbird, apparently suffering from the very same problem.

  16. Ben Huson
    Member
    Plugin Author

    Posted 1 year ago #

    So there seems to be an InkThemes theme to these issues...

    I download a trial version of the blackbird theme. The offending code that is causing the issue is the following which automatically runs a function to add the home page to every wp_list_pages() call:

    add_filter('wp_list_pages', 'inkthemes_nav_menu_items');

    You can remove this by adding the following to your theme's functions.php file, below all the includes at the top, but this will remove home from every use of wp_list_pages() on your site.

    remove_filter('wp_list_pages', 'inkthemes_nav_menu_items');

    I'll add in some filters to the List Pages Shortcode plugin so that it will be possible to remove it just for the shortcode output.

  17. zoltandragon
    Member
    Posted 1 year ago #

    Awsome! Thank you! :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic