• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

MINIMUM Theme: Adding the post and page title to page-title.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › MINIMUM Theme: Adding the post and page title to page-title.php

This topic is: not resolved

Tagged: minimum, minimum 2.0

  • This topic has 5 replies, 3 voices, and was last updated 13 years ago by emke.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • January 23, 2013 at 9:25 am #14049
    Jones
    Member

    Hi, When opening posts and pages I want to echo the title of that page inside page-title area. Now it displays the description only.

    this is what it is now:

    elseif ( is_singular( 'page' ) ) {
    echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="#">' . __( 'Subscribe Now', 'minimum' ) . '</a></p></div></div>';

    thanks in advance

    January 25, 2013 at 12:14 pm #14653
    SoZo
    Member

    That is actually rather difficult since it's outside the loop.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    February 6, 2013 at 5:51 pm #18546
    emke
    Member

    I'm actually looking for the same thing as Jones. Any pointers on what to do?

    February 7, 2013 at 5:56 am #18625
    Jones
    Member

    I managed to fix it myself, here is the solution @emke:


    if ( is_home() ) {
    echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    elseif ( is_404() ) {
    echo '<div id="page-title"><div class="wrap"><p>' . __( 'Ooops!', 'minimum' ) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    elseif ( is_post_type_archive( 'portfolio' ) || is_singular( 'portfolio') ) {
    echo '<div id="page-title"><div class="wrap"><p>' . __( 'From the Portfolio', 'minimum' ) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    elseif ( is_singular( 'page' ) ) {
    echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_the_title($ID)) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    elseif ( is_singular( 'post' ) ) {
    echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_the_title($ID)) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    elseif ( is_author() || is_category() || is_date() || is_search() || is_singular() || is_tag() ) {
    echo '<div id="page-title"><div class="wrap"><p>' . __( 'From the Blog', 'minimum' ) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }
    else {
    echo '<div id="page-title"><div class="wrap"><p>' . esc_html( get_bloginfo( 'description' ) ) . '<a class="page-title-button" href="/contact">' . __( 'Neem direct contact op', 'minimum' ) . '</a></p></div></div>';
    }

    This displays the page title at pages and posts. Its translated so dont mind the 'neem direct contact op'

     

    let me know if this helped you

    February 7, 2013 at 4:53 pm #18774
    emke
    Member

    Yeah, I also managed to get it to work in the mean time. Thanks for your help! 🙂

    February 8, 2013 at 6:08 pm #19121
    emke
    Member

    Hi,

    so I have a problem I cannot figure out how to solve. On my blog page I get the last post title in my page-title area. I would like to have only "Blog" or what ever as the blog page is showing several posts and not only the last one. This is the code I currently have:

    <?php

    if ( is_home() ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . esc_html( get_the_title($ID)) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }
    elseif ( is_404() ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . __( 'Ooops!', 'minimum' ) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }
    elseif ( is_singular( 'page' ) ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . esc_html( get_the_title($ID)) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }
    elseif ( is_singular( 'post' ) ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . esc_html( get_the_title($ID)) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }
    elseif ( is_author() || is_category() || is_date() || is_search() || is_singular() || is_tag() ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . __( 'From the Blog', 'minimum' ) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }
    else {
    echo '<div id="page-title"><div class="wrap"><h1>' . esc_html( get_bloginfo( 'description' ) ) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }

    I've tried adding:

    }
    elseif ( is_blog() ) {
    echo '<div id="page-title"><div class="wrap"><h1>' . __( 'Ooops!', 'minimum' ) . '</h1><a class="page-title-button" href="/contact">' . __( 'Contact', 'minimum' ) . '</a></div></div>';
    }

    but then nothing works. Can anyone help me out please?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble