Is there a conditional tag to change the way the page title is displayed for one specific page? for example, i want to title a page "ice cream cones" but in the navigation bar i'd like it to appear as "home". is that possible?
Page Titles
(10 posts) (2 voices)-
Posted 1 year ago #
-
robk30 - You would need to edit the
sandbox_globalnav()function in thefunctions.phpfile to change the navigation to what you are wanting it to be.function sandbox_globalnav() { $menu = '<div id="menu"><ul>'; if ( is_home() ) { $menu .= '<li class="current_page_item"><a href="'; } else { $menu .= '<li><a href="'; } $menu .= get_option('home') . '/" title="Home">Home</a></li>'; $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li= &sort_column=menu_order&echo=0&exclude=51,60,64') ); $menu .= "</ul></div>\n"; echo $menu; }If you want to change the title that shows in the browser, you can edit the
header.phpfile to change the wording that inserted into the HTML title tag.You get more info about using WordPress conditional tags here.
Posted 1 year ago # -
perfect - thanks.
how about for a site like this:
echoparkhomesforsale.comwhere the home page is a static page called "home" and the blog is under "featured properties"? i'd like to change the title of the home page to "welcome to echo park homes for sale" but in the nav bar have it say "home". is that possible?
robPosted 1 year ago # -
I would just use a page template for the "home" page. Call it home and then edit the page template to say what you want at the top, rather than home. Information on page templates is here. You can also use the
links.phpfile to start your home page template, just make a copy of it and start editing.Then, you'll have to set your current "home" page to use the new page template. That way you don't even have to mess with rewriting the function above...
Posted 1 year ago # -
got it - thanks. how do i remove the links from the links template? or is there another template i can copy to have just a plain page like the "default template"?
what part of the template do i edit to have "welcome" as the header and "home" in the nav bar?
THANKS!
Posted 1 year ago # -
Compare the links.php file and the page.php file. You can just use the commenting method on top of the links file and the content area like the page file. The title will be inside the
<h2..>tags.Posted 1 year ago # -
will - that worked perfectly for the home page for eaglerockhomesforsale.com but the posts page (featured properties) seemed affected by it for some reason. this is what i have in the home.php template ("featured properties" is using the default template) - should i change anything?:
<?php
/*
Template Name: Home
*/
?>
<?php get_header() ?><div id="container">
<div id="content"><?php the_post() ?>
<div id="post-<?php the_ID(); ?>" class="<?php sandbox_post_class() ?>">
<h2 class="entry-title">Welcome To Eagle Rock Homes For Sale</h2>
<div class="entry-content">
<?php the_content() ?><?php edit_post_link(__('Edit', 'sandbox'),'<span class="edit-link">','</span>') ?>
</div>
</div><!-- .post --><?php if ( get_post_custom_values('comments') ) comments_template() // Add a key/value of "comments" to enable comments on pages! ?>
</div><!-- #content -->
</div><!-- #container --><?php get_sidebar() ?>
<?php get_footer() ?>Posted 1 year ago # -
DId you delete the page.php file? Make sure you still have a page.php file.
Also, change the filename of home.php to something like page-home.php and remap your "home" page in admin. Any file with the name "home.php" will become the home page in the WP template structure...
Posted 1 year ago # -
Will - so far so good, except when you click on a post, the widgets I have set to appear only on the "blog" page via widget logic disappear. If i wanted to certain widgets to appear in the sidebar of every post, what would I have to add them to via widget logic? hope this makes sense....to see an example check out this post:
http://takesunset.com/2009/08/flip-it-2310-brier-ave-in-silver-lake/
it is missing the widgets found in the sidebar on takesunset.com/blog.
robPosted 1 year ago # -
You would need to look at the configuration options of the Widget Logic plugin.
Posted 1 year ago #
Reply
You must log in to post.