Forum Moderators: not2easy

Message Too Old, No Replies

Wordpress Inline Link in navbar is duplicated

         

renet

7:20 pm on Aug 28, 2008 (gmt 0)

10+ Year Member



Okay, on my horizontal nav bar I have:

welcome, welcome, about us, etc, etc, etc

1 Page is named: Welcome
and I would like the content of that page to the the "home page" or "index page".

Also, I do not like to use the word "home" for my home page for a navbar title.

In the header file I have:

<!-- header -->

<div id="header">
<div id="logo"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></div>
<div id="menu">
<ul>
<li><a href="<?php echo get_settings('home'); ?>/" title="Home">Welcome</a></li>
<?php wp_list_pages('title_li=&depth=1' ); ?>
</ul>
</div>
</div>
<!--end header -->

If I switch "Welcome" to "Home" than the Nav Bar will read:

Home, Welcome, About Us, Etc., Etc.,

IN the wordpress admin panel under "reading" / settings
I have front page set to Welcome

when it is set this way the URL shows as: domain.com

but, if I choose front page to display a static page and do not choose a static page than when clicking on the url (the second link on navbar) for welcome it becomes: domain.com/welcome

and than if I click on the first "welcome nav bar link - which could be renamed 'home' as per above.. than the domain is:
domain.com but the page is a sorry not found page.

So, in summary I would like a link that says: Welcome rather than home and would like it to not duplicate in the nav bar.

Hopefully, I have done well in explaining my question.

renet

12:53 am on Aug 29, 2008 (gmt 0)

10+ Year Member



I think what I am really asking is -

this call: <li><a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a></li>

allows a link to be on the nav bar so that someone can always go back to the home page - for example.

and

I like this blog / website to use the static page feature to display rather than the latest posts.

So, I think it is redundant to have a link that says Home which comes from the call in the header and it leads to the pure domain.com url

than you have to chose which static page displays so I choose welcome and when you read the URL you also have: domain.com only instead of domain.com/welcome

But, the redundant part is seeing the welcome screen and than as a consumer out of curiosity I click the "home" link to see the main page of the website.. nothing happens.. nothing changes..

so, you and I know what's going on but this might confuse the end user.

Is there a workaround so that I dont have to have the "home" page link + the static page link showing in the nav bar. Since they both render the same page.?

Regards

Marcia

1:45 am on Aug 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Every single page in WP is related to index.php including index.php?p=999 except home.php which has a different significance and is meant to be the "front door" of the blog - at least that's how it was several versions back.

What's the page name (like foo.php) of what you're saying should be the static front page, and which page template is being used for it?

[Disclaimer: I can't be too much help, I'm just getting into WP tags and customization and sit with a book open next to me every step of the way).]

renet

1:53 am on Aug 29, 2008 (gmt 0)

10+ Year Member



Webmasterwoman.... you're doing something right! PR4!

Welcome is the Static Page

Not sure what you mean about page template?

Thanks

Marcia

3:06 am on Aug 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In your WP Admin panel, go to

Design > Theme Editor

On the right side, you'll see a column with a list of all the template files, including page.php which is way at the bottom usually. You can actually make custom page or category templates and upload them with FTP, when you figure out what the WP tags are, what they do, and where to put them.

PR4 was until just recently PR5, and will get ported over to a CMS in due time. Meantime, I'm "playing" with customization in a subdirectory of an old PR0 domain (did the 5 minute install), using Kubrick and a book and referring to the codex for detail in depth. Basically, the bare essentials (aside from the functions and back end) for WP are:

index.php
header.php
sidebar.php
footer.php

which are includes except for index.php and of course the css file.
page.php is a template for static pages rather than posts (and archives), and home.php apparently has a special meaning.

swa66

1:00 pm on Aug 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since it's generated html (php) that's your problem (not CSS), you might be much better off asking in the appropriate forum.

renet

5:38 pm on Aug 29, 2008 (gmt 0)

10+ Year Member



Thanks swa66!

Marcia

6:32 pm on Aug 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




<!-- header -->

<div id="header">
<div id="logo"><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></div>
<div id="menu">
<ul>
<li><a href="<?php echo get_settings('home'); ?>/" title="Home">Welcome</a></li>
<?php wp_list_pages('title_li=&depth=1' ); ?>
</ul>
</div>
</div>
<!--end header -->


That menu looks to be an unordered list, and if it's in the header include then it must be the navbar where the "Pages" are being listed in this theme, rather than in the sidebar.

wp_list_pages would be a WP function that fetches and puts the Pages that are created into the list, but the first one [get_settings]looks like it's hard coded to call a function that puts out a link to the 'home' or main/root page of the site.

Marcia

9:51 am on Aug 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Details are in this section of the Codex, including creation of page templates and excluding certain pages from appearing in the list if necessary.

[codex.wordpress.org...]

renet

8:38 am on Sep 4, 2008 (gmt 0)

10+ Year Member



Thanks!

I removed the php call function for 'pages' in the header and than just added the links: <ul><li>example.net/about-us (and etc...)