Hi, Can anyone know how to add a home page link in wordpress blogs? The link should be visible only in the home page, not in the other pages. If any know, then give your ideas. Regards,
Well, Sitewide links comes on all pages, and Homepage Links comes only on the Homepage! But what exactly do you mean by Adding Home Page Link? Adding A Link on the Home page? Or Adding the Link of Your Home in Home itself? For Putting links on Home page, Go to theme editor, take index.php And put <a href="url.com">Your Text</a> At the right place where you need it!! If you want it sitewide, You should add the code on Index.php, PAge.php and single.php!! You can also put it in header or footer by putting it in header.php and footer.php!! ~ExP~
I need my link to be displayed only on the homepage. I don't want to display that link in any other pages.
Ok hereyou go. Code for homepage link only <?php if ( is_home() || is_page() ) { ?> [B]Homepage Link[/B] <?php } ?> Code (markup): DON.
PM me if you have any more question. <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?> Your HomePage Link <?php } ?> Code (markup):
First open your theme’s functions.php file and paste the following code: function home_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'home_page_menu_args' ); Once you have pasted this code, It should add “Home†as an option under the “Pages†widget on the Menu management page so the user can simply check it off as an item to add to their custom menu.
If We Keep It In Index.php, It will Only be Shown In the HomePage!! I bet, Well, Am Not A Newbie to WP ~ExP~
No mate, the link will be shown in all the pages including HomePage. You can check it. I tried as you said. But, it is same like a SiteWide Link.
I tried this, but i didn't get the result as you mentioned. I can't find "Home" option in my Pages Widget
CAn You Please SHUT UP?? Placing it in Index.php Will Not Show it On Any other Pages other than Home!! First of All, You started this thread since you dont know how to do it, And Now are you teaching me?? I agree DeluxDon's Wpbased PHP code, But, actually, there is no need of that, if we can place it from Index.php! ~ExP~
Their is a simpler method for adding links to sidebar instead of fiddling with php. Their is a simple plugin called "Widget Context". It allows you to show a specific widget at particular places. Install the plugin, add a text widget with your link and set it to appear on homepage only. Voila!