WordPress.org

Support

Support » How-To and Troubleshooting » Name of the website as Post

Name of the website as Post

  • I don’t know if its a repost as i tried to search but couldn’t find it. What i am looking is how can i make something like this:

    http://ankitrawat.com/blog/

    In this site the name or the title of the site is different on homepage & as you click on any post the title & the name on the header changes to the tags or the post.

    Please help me how can i do that what plugin or code changes this guy has done?

    Thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • look in your theme folder – header.php – near the top there should be a <title> tag that does it.

    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

    this is what i have

    <h1 class="title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p class="desc"><?php bloginfo('description'); ?></p>

    so now what changes should i make, sorry but i m not a tech guy & this is my first time i am working on wordpress or any other php script myself 🙁

    Jeremy Clark

    @jeremyclark13

    Member

    Look further up than that. It should be in the <head> section

    this is the full header.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <script src="<?php bloginfo('stylesheet_directory'); ?>/js/js_liveclock.js" type="text/javascript"></script>
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="wrap">
    <div id="top">
    <div id="header">
    <h1 class="title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p class="desc"><?php bloginfo('description'); ?></p>
    </div>
    <div id="clock"><script type="text/javascript">showdate();</script></div>
    </div>
    <div id="nav">
    <ul class="nav">
    <li class="first"><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('title_li='); ?>
    </ul>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    </div>
    <div id="main">

    sorry but i dunno what to do thats why i am pasting tehw hole thing may be that way you guys can help me better 🙂

    what i am looking is that the header or the page becomes the post of the site like my site’s name is ABC

    header on hope page says

    ABC
    Tagline

    both of which is done from General Setting)
    now if sum1 is checking out a post XYZ then the header has sumthng like

    XYZ
    ABC < is small size like the tagline

    thnx

    You’ll be changing this line,

    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>

    I realize you don’t know the code, but, this is how you start to learn it. Read it like English. You can see what’s happening in general.

    Here’s the template tag (the code) used to display your Post title (example XYZ)

    <?php single_post_title(); ?>

    Maybe try changing in your header.php to something like this:

    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> <?php single_post_title(); ?> <?php } ?> <?php wp_title(); ?></title>

    Then you will need to mess with it some more after that to get just exactly what you want. Or ask again for more help.

    If you want to know what any of those codes / template tags does, search for it in the Codex, for example:
    http://codex.wordpress.org/Template_Tags/wp_title

    Jeremy Clark

    @jeremyclark13

    Member

    Here’s some code that should work

    <div id="header">
    <h1 class="title">
    <?php if ( is_single() ) { ?><a><?php wp_title('',true,''); ?></a><?php } else { ?><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a><?php } ?></h1>
    
    <?php if ( is_single() ) { $description = "<a href=\"".get_bloginfo('home')."\">".get_bloginfo('name')."</a>"; }
    else {$description = get_bloginfo('description');}
    if (!empty ($description)) { ?>
    <p class="desc"><?php echo $description; ?>
    <?php } ?>
    </div>

    hey Dgold i tried what you said but it changes the title on the top of browser as ABC Post & the header name remains same as ABC

    but what i am looking is change the Header name to Post & for pages like about or home page just what can be set default if not all then atleast just the Home page

    i hope you guys are getting me so as per your advice when i looked at the code i thik the changes have to be done sumwhere here:

    <h1 class="title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    <p class="desc"><?php bloginfo('description'); ?></p>

    since it is what shows the header name as
    ABC
    Tagline

    i wanted to make the Tagline as ABC with hyperlink to homepage which i was able to do but unable to get Post instead of ABC 🙁

    so please experts help

    Just want to make sumthng like
    http://ankitrawat.com/blog/

    Check out header name as

    Google and SEO (Search Engine Optimization)

    Ankit Rawat – SEM (Search Engine Marketing) & SEO Blog

    when u open any post like http://ankitrawat.com/blog/delhi-bomb-blasts/
    it becomes
    Delhi Blasts, Delhi Bomb Blast, Delhi Bomb Blasts

    Ankit Rawat – SEM (Search Engine Marketing) & SEO Blog

    Jeremy Clark

    @jeremyclark13

    Member

    The code i posted above will do what you want.

    oops sorry for posting… jeremy ur the man bro.. it did work to 90% of what i was looking for… thnx i will try rest myself first before troubling u guyss 😛

    For fun I tried my own version of that code posted by jeremyclark13. It works, and it’s pretty cool seeing my Post Title as the h1 header in place of my blog title. It’s more dynamic up top :->

    Thanks for the cool idea

    your welcome Dgold.

    jeremy i was thinking if instead of my blog title on the home page if i can get the latest blog post title on the home page & downunder the title : description rather then just description. Making the homepage look like this:-

    LATEST BLOG POST TITLE
    Title : Description (with hyperlink to my home page

    Rest the post page would be like:
    BLOG POST TITLE
    Title : Description (with hyperlink to homepage ofcourse)

    What should be the possible code for this.

    Thank alot in advance

    i was expecting a reply from sum1 🙁 do i need to put this question in a new topic????

    do i need to put this question in a new topic????

    Don’t even think of it!
    I am quick with the delete button when it comes about duplicate topics.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Name of the website as Post’ is closed to new replies.
Skip to toolbar