Going Green – Replace Site Title with Page Title

Community Forums Forums Design Tips and Tricks Going Green – Replace Site Title with Page Title

This topic is: not resolved

This topic contains 9 replies, has 2 voices, and was last updated by  rfmeier 9 months, 3 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #89267

    GoalSetter40s
    Participant
    Post count: 6

    I’m using the Going Green theme v.3.0 with WP 3.8.1. In the theme customization, you can set the “Site Title”. This appears as an H1 tag on every page, which is not my preference. I know how to remove the “Site Title” by leaving this field blank, altering the style sheet or using a plugin called “Genesis Title Toggle”.

    I would like to place the page title (from the meta title tag) in this same place, ideally without modifying the functions.php file and instead with a plugin, or even better, by using some PHP code in one of the various fields available in the “Genesis Simple Hooks” plugin. Here is my URL:

    http://www.pawleysislandscrealestate.net/real-estate/

    Please advise. Thanks!

    http://www.pawleysislandscrealestate.net/real-estate/
    #89340

    rfmeier
    Participant
    Post count: 603

    Hello,

    When you say, “from the meta title tag”, are you referring to the Custom Document Title under the Theme SEO Settings when editing a page within the WordPress admin?


    #89355

    GoalSetter40s
    Participant
    Post count: 6

    Sorry, I didn’t use the correct term. I meant to say “from the page titles” not “from the meta title tag”. I’ll try to be clearer in this explanation:

    I want the page titles visible, but in a different place then where they are appearing. If you look at , you’ll see “Pawleys Island Community Map” displayed in a brown font color, large font. I want that text to appear above in the green section where it currently says [“This is placed by the “Genesis – Simple Hooks” plugin in the genesis_header Hook section. It would be nice to have the page title here. PHP code is working as you can tell this current time: Sat Feb 08, 2014 18:09 pm”].

    I suppose it could avoid placing PHP code in “Genesis – Simple Hooks” plugin, and instead use some CSS positioning to move it there, but it just seems cleaner and more lightweight to use some PHP code to place it in the “Genesis – Simple Hooks” plugin in the genesis_header Hook section.

    Does this make sense?

    #89374

    GoalSetter40s
    Participant
    Post count: 6

    I just noticed that my link didn’t show, so I’ll put it here:

    #89375

    GoalSetter40s
    Participant
    Post count: 6

    Weird, this is the second attempt to add my link using the [link] button on the toolbar of the forum editor. I’ll try again, this time without using the [link] button:

    http://www.pawleysislandscrealestate.net/real-estate/pawleys-island-homes-for-sale-map/

    #89376

    GoalSetter40s
    Participant
    Post count: 6

    Apparently, my URL is too long (it’s 85 characters) for the link code to display, so use this shorter example link instead:

    #89377

    GoalSetter40s
    Participant
    Post count: 6

    Ok, I give up on posting my URL link, but that’s OK, because it’s the same link that I posted originally in my opening post.

    #89401

    rfmeier
    Participant
    Post count: 603

    I got a chance to look at it. I was able to add two callbacks to start the to get this functionality. I do not have this theme, so I just used the Genesis Sample theme.

    1. If on a page or single post, add the page or post title to the ‘genesis_header’ area.
    2. If on a page or single post, remove the default post or page title.

    I hope this gives you a start.


    • This reply was modified 9 months, 3 weeks ago by  rfmeier.
    • This reply was modified 9 months, 3 weeks ago by  rfmeier.
    #89409

    GoalSetter40s
    Participant
    Post count: 6

    Thanks, Ryan. I pasted your code into the genesis_header block and ticked the “Execute PHP on this hook” box. Nothing appears is the space. What I was hoping to appear is the phrase “Real Estate” as this is the page’s title. I even deactivated the “Genesis Title Toggle” plugin to make sure it wasn’t interfering.

    Do I need to state my theme name somewhere in the PHP code that you provided or was I supposed to use a snippet of your code? Sorry, I’m not well versed in PHP. Thanks for your help.

    #89416

    rfmeier
    Participant
    Post count: 603

    I should have said that code was meant for the functions.php file. They won’t do anything inside of another action callback. Try the following with the Genesis – Simple Hooks plugin.

    If there is a ‘genesis_header’ field, you can paste the following code inside;

            //	if not single page or post, return
    	if( ! is_singular() )
    		return;
     
    	//	display the post title
    	genesis_do_post_title();

    If there is also a ‘genesis_before_entry’ field, you can paste the following code inside;

            //	if not single page or post, return
    	if( ! is_singular() )
    		return;
     
    	//	remove all default header hooks
    	remove_all_actions( 'genesis_entry_header' );

    As you did before, make sure to check the Execute PHP on this hook checkbox.


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

You must be logged in to reply to this topic.