Title tag and site description in SimpleMarket

Hi,

Sorry, this is probably a basic coding question but I can't figure out how to substitute the site description in the title tag with another term such as my domain name. Here's the relevant code. I'm trying to change the title tag for posts and pages.

<title>
<?php global $page, $paged;
wp_title( '|', true, 'right' );
bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', TEMPLATE_DOMAIN), max( $paged, $page ) );

  • aecnu
    • WP Unicorn

    Greetings mark77210,

    <?php bloginfo(’name’); ?> is the correct syntax for coding the site title.

    Keep in mind that if there is an update to the theme involved, that your hard coded change will be lost if you do not take precautions.

    To avoid this myself regarding this type of change, I use SEO Ultimate plugin to modify most of these aspects and not worry about hard coding in this case.

    Please advise if either of these possible solutions works for you.

    Cheers, Joe

  • Mark
    • The Incredible Code Injector

    Hi Joe,

    In my case the site title is not my domain name. The theme allows you to write in your own text for the site title. I don't want that text appended to my blog titles .. I prefer to put my actual domain name or some other text there. Do you know how I would go about changing that? I'd prefer to do it with a simple hard code change and not have to add yet another plug-in. :slight_smile: I'll be using a child theme so there shouldn't be a problem, right?

    Cheers,
    Mark

  • mrarlen
    • New Recruit

    Hi Joe,

    With a child theme, you can modify the single.php and page.php with different code from the home.php or index.php.
    That will allow you to change the tiles on those pages.

    Sorry I can't be more helpful without knowing exactly what you wish to put on the pages/posts.

    Aloha,
    arlen

  • aecnu
    • WP Unicorn

    Greetings Mark,

    You are absolutely correct that hard coding while maintaining the files in the child theme should not be a problem.

    For the site domain name the statement I mentioned above would instead be <?php bloginfo(’url’); ?>

    In addition, though I may stand to be corrected depending on the theme authors desire, much of this probably can be coded into the header.php file.

    The plugin I mentioned above is an absolutely amazing piece of work and included in all of our productions sites though not all aspects of it do we incorporate.

    @arlen I think maybe you should have been addressing Mark in this ticket. Some rep points for you for trying to help out another member.

    Mark please advise me of whatever option you decide to go with and works for you.

    Cheers, Joe

  • aecnu
    • WP Unicorn

    Greetings Mark,

    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU Dev member!

    Cheers, Joe

  • Mark
    • The Incredible Code Injector

    Hi again guys, I'm reopening this thread.

    Maybe I don't understand how the Site Title is controlled in SimpleMarket. It's one of the few things you can change in the theme options manually, which is good, but it seems to creep in everywhere, which is not so good.

    Allow me to clarify: My particular issue is that the Site Title by default is appended to a page or post's Title Tage when the page or post is created. I don't want that to happen but I can't figure out where to change it.

  • aecnu
    • WP Unicorn

    Greetings Mark,

    Thank you so much for the screen shot, it is greatly appreciated and tells the tale.

    Oh no, I am going to have to disclose one of my favorite plugins and secret weapons for dealing with this subject and many other great features ..... SEO Ultimate plugin.

    Install this fantastic plugin, network or site activate (I prefer to network activate myself, and then in the site admin dashboard go to --> SEO --> Title Tag Rewriter --> and remove the "| {blog}" after each place that you do not want this and you should be all set.

    Please advise and let me know what you think of this plugin.

    Cheers, Joe

  • Kerry
    • Recruit

    Just a note to add for any potential beginners that may not have this exact configuration and might be using another theme and/or other plugins.

    Any WordPress SEO plugin will likely be able to accommodate this option from within the main settings configuration page of the plugin and some themes also include this feature in a header area.

    Changing what shows up in a title tag can also be somewhat controlled simply within the core WordPress FIles by logging into the admin area and going to Settings > General and adjusting the title. Your site title does not need to match your domain name.

  • Mark
    • The Incredible Code Injector

    Kerry, you kickstarted my brain. I am currently using WPMU Dev's Infinite SEO plug-in, which it seems can only be activated on a Network level. (I had not been looking there for those additional settings.) Unless I am missing something, that means if I want to get rid of the appended title tag it will affect all of my sub-sites. That's not good.. not sure why it doesn't allow site by site control. So I guess I will keep it and place keywords in there instead of my site name. Joe, I'll check out the Ultimate SEO plug-in you mentioned- all else being equal, do you recommend it over Infinite SEO?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.