• Hello

    not sure if I should post this in the ‘beyond codex’ forum but here’s what I’d like to do…

    Somehow I want to find out the the h1 entry-title for the content of the front page.

    I want it so that if a person selects a static specific front page in the customise bit of WP that I can take the ‘post-title’ of that page and echo it as a variable somewhere else.

    Thanks in advance for any sugestions
    will post in beyond codex forum too
    🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    So you want to hide a title on a specific page?

    Thread Starter Kanger

    (@kanger)

    No what I have and want to do is as follows:

    My static front page has a nice big header, then a posts section where it shows the latest post nice and large across, then below that are small exerpts in columns from the 3 previous posts before that. Then further down the page is the content from the actual page (front-page.php) I posted in the admin bit of wp which says ‘About’ then a few paragraphs.

    I want to find out what the post title is whether it be ‘About’ or anything else and then echo that in a<a> tag (just above that section) and also echo it in the navigation menu, so in the menu bar at top of each page I will have a link to the ‘About’ bit on the front page.

    Hope that makes sense, I’m working on it locally right now, so haven’t got a link to send

    any ideas much appreciated
    thanks in advance

    Thread Starter Kanger

    (@kanger)

    oops didn’t mean to make that all a link should have put

    <a name= >

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can do things like getting the post title and comparing it to see if it’s “about” for example, or maybe you’d want to get the post ID instead.
    E.g.:

    if (get_the_ID() == 30) {
        // Do your stuff
    }

    http://codex.wordpress.org/Function_Reference/get_the_ID

    Thread Starter Kanger

    (@kanger)

    Thanks but I want to set it up as a theme people can download and use without having to do any techy stuff.

    That’s why I was hoping to get it from it being static front page

    Don’t know if that’s possible? 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to….’ is closed to new replies.