WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Get the static page IDs in Settings > Reading

[Resolved] Get the static page IDs in Settings > Reading

  • I was wondering if there was a way to get the pages’ ID in the “Settings > Reading” panel for both “Front page” and “Posts page”. I’d like to use these options (if set) to add the home page to my custom breadcrumb and the posts page as the “news” page. From that ID, I could get the post title and permalink to set up my breadcrumb…

    I’d prefer using this (if possible) instead of hardcoding it…

    My breadcrumb would then looks like in a post:
    Home > News > My post title (which is renamed into news for this theme)

    Or in a page:
    Home > Parent page > Sub page > Sub sub page

    Any idea how it can be done? I didn’t find anything about this… :S

    Thanks!

    P.S. No, I do not use any plugins for my themes, please, do not suggest one.

Viewing 2 replies - 1 through 2 (of 2 total)
  • if set under dashboard – settings – reading:

    the static front page id is:

    get_option('page_on_front')

    the posts page id is:

    get_option('page_for_posts')

    Still can’t believe I couldn’t find these. I guess I could have if I scrolled through all the options in the options.php page… O.o

    Though I never saw these anywhere through all my searches :S

    Thanks for the help! Will be helpful once I get back to work 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Get the static page IDs in Settings > Reading’ is closed to new replies.
Skip to toolbar