WordPress.org

Ready to get started?Download WordPress

Forums

Name of the website as Post (18 posts)

  1. GodFather187
    Member
    Posted 5 years ago #

    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

  2. maestro42
    Member
    Posted 5 years ago #

    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>
  3. GodFather187
    Member
    Posted 5 years ago #

    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 :(

  4. Jeremy Clark
    Moderator
    Posted 5 years ago #

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

  5. GodFather187
    Member
    Posted 5 years ago #

    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 :-)

  6. GodFather187
    Member
    Posted 5 years ago #

    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

  7. Dgold
    Member
    Posted 5 years ago #

    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

  8. Jeremy Clark
    Moderator
    Posted 5 years ago #

    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>
  9. GodFather187
    Member
    Posted 5 years ago #

    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

  10. GodFather187
    Member
    Posted 5 years ago #

    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

  11. Jeremy Clark
    Moderator
    Posted 5 years ago #

    The code i posted above will do what you want.

  12. GodFather187
    Member
    Posted 5 years ago #

    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 :-P

  13. Dgold
    Member
    Posted 5 years ago #

    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

  14. GodFather187
    Member
    Posted 5 years ago #

    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

  15. GodFather187
    Member
    Posted 5 years ago #

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

  16. moshu
    Member
    Posted 5 years ago #

    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.

  17. GodFather187
    Member
    Posted 5 years ago #

    i thought may be its a bit different question so no1 is replying.. i apologize for any mistake i was just wondering may be i might get a reply then :P

  18. GodFather187
    Member
    Posted 5 years ago #

    can anyone tell me the template tag for the title of the most recent post on home page.

    Since i wanted my homepage to have the header change automatically on the basis of the recent post so that it may appear like:

    If anyone can help me with the code or atleast tell me what should be the possible template tag for the same.

    i did post a new thread but it was closed by moshu i thought it is different from this topic.

    i did go to http://codex.wordpress.org/Template_Tags but cud nto find it so moshu or jeremy plz help

Topic Closed

This topic has been closed to new replies.

About this Topic