Header Question
-
I am hoping that you can help with the content of my pages.
My site is Rhymes For All Times
In the HEADER- how can the code be changed so the phrase “A Poetic Look At Life In New York City” just shows up on the Home page?
-
I guess I was answering this in your other thread as you were posting this.
http://wordpress.org/support/topic/345547?replies=3#post-1329380
Thank you Chris but I am not sure where this change is inserted.
Here is a copy of my Header code
Thank you very much<!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" <?php language_attributes(); ?>> <head> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" /> <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<?php bloginfo('atom_url'); ?>" /> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> <?php wp_head(); ?> </head> <body> <!-- HEADER --> <div id="wrapper"> <div id="header"> <div id="raccoglitore"> <div id="logo"><h1><a>" title="<?php bloginfo('description'); ?>"><?php bloginfo('name'); ?></a></h1><h2><?php bloginfo('description'); ?></h2></div> <div id="rss"><a>" ><img alt="Tieniti sempre aggiornato sulle ultime di Skimbu!" src="<?php bloginfo('template_directory'); ?>/images/rss.png" /></a></div> </div> <div id="navbar_top"></div> <div id="navbar"> <ul> <li class="page_item"><a>">Home</a> <?php wp_list_pages('sort_order=desc&title_li='); ?> </ul> </div> <div id="navbar_bottom"></div> </div> <div id="content"> <!-- END HEADER -->In your header find:
<h2><?php bloginfo('description'); ?></h2>Replace it with
<?php if (is_home()) { ?> <h2><?php bloginfo('description'); ?></h2> <?php } ?>Chris, thank you very much. It worked great! I would have never been able to figure that one out myself. Now that we’re on a roll- how about another.
How do you get the author name to only show up on the home page and not on any other pages.
Thank youGlad it helped.
Pretty much the same deal for the next one. WordPress themes use Template Tags to display data. Locate the theme file that has the tag that your theme is using to show the author’s name (it’ll probably have “author” in the name) and then use a similar if statement like we used above.
Without knowing what your blog theme is or looks like I can only make a guess that you probably want to check the theme’s
index.phpfile.I hope that gets you in the right neighborhood.
Chris,
This looks like the place in the index php file to make the change.
Can you hold my hand again and tell me what to do.
thanks
<h2>By <span style=”color:#0066FF”><?php the_author() ?> <?php if(function_exists(‘the_views’)) { the_views(); } ?></span></h2>OK, here we go:
In your theme’s index.php file find:
<?php the_author() ?>Replace it with
<?php if (is_home()) { the_author(); ?> } ?>See if that’ll work.
Ok, we’re only batting 50%- that one didn’t work as got error message when I visited the site. Any other thoughts
Thank you.
If other thoughts fail, do you think I could just eliminate that code <h2>By <span style=”color:#0066FF”><?php the_author() ?> <?php if(function_exists(‘the_views’)) { the_views(); } ?></span></h2>
from the index php file and just put my name on the top of each post as they are done on home page?What was the error? I may have tossed in an extra semi-colon…
<?php if (is_home()) { the_author() ?> } ?>I’ll put in the code again and let you know
here is the error message
Parse error: syntax error, unexpected T_ENDWHILE in /home/nyres2/public_html/rhymesforalltimes/blog/wp-content/themes/skinbu/index.php on line 19here is how the index php is coded
<?php get_header(); ?>
<!– LEFTBAR –>
<div id=”leftbar”>
<?php while (have_posts()) : the_post(); ?>
<div id=”post”>
<h1>“><?php the_title(); ?></h1>
<h2>By <span style=”color:#0066FF”><?php if (is_home()) {
the_author() ?>
} ?><?php if(function_exists(‘the_views’)) { the_views(); } ?></span></h2><div id=”postcontent”><p> <?php the_content(”); ?> </p></div>
Chris,
somehow, I fixed it by going to page.php with original code
<h2>By <span style=”color:#0066FF”><?php the_author() ?> <?php if(function_exists(‘the_views’)) { the_views(); } ?></span></h2>
I put <!– before code and –> after code and now it shows just as I wanted it with Author only showing on home page.
Thank you very much and am sure will benefit from your help in future as still have a few unresolved issues but tortured you enough tonite.
The topic ‘Header Question’ is closed to new replies.