Here’s a quick post to help you add Google Analytic tracking code to your phpLD (php link directory) template. Because phpLD uses the Smarty template system, simply opening the footer.tpl and placing the Analytic code before the closing body tag will result in an error.

You need to tell Smarty not to parse the code between the script tags. To do so, open your templates/footer.tpl file, and right before the closing body tag, place your Google code like this:

1
{literal} Your-Google-Analytics-Code-Here {/literal}

Now save and put. That’s it!

If you want to display a particular content only on WordPress home page, you have to use is_home()

For example:

1
2
3
4
5
6
7
<?php if(is_home()) { ?>
<div id="mx">
<p>
This is how you <a href="http://www.linkau.com">Display content</a> only on home page!
</p>
</div>
<?php } ?>

This is how you will show display your content only on home page.

If you want to exclude content only from home page then you need to use else condition

For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php if(is_home()) { ?>
<div id="mx">
<p>
nothing here
</p>
</div>
<? } else { ?>
<div id="mx">
<p>
This is how you <a href="http://www.linkau.com">Display content</a> only on home page!
</p>
</div>
<?php } ?>

As per Search engines like google, yahoo, bing, the site url http://freewpdownloads.com and http://www.freewpdownloads.com will be considered as different.

People from different part of the world will access your site with both non www url and with www url from search, refer sites, links etc.

So this will be divided into half and you get only 50% benefit. Solution to make it 100% benefit is to redirecting non www url to www url

 

Here is how you make it. Put this code at the top of your .htaccess file.

1
2
3
4
5
[pre]
# Non www url to www url
RewriteCond %{HTTP_HOST} !^www\.http://freewpdownloads\.com
RewriteRule (.*) http://www.http://freewpdownloads.com/$1 [R=301,L]
[/pre]

Note: Don’t forget to change the name of your domain from the above code.

from freewpdownloads.com to yourdomain.com

Some of the wordpress have footer links like Privacy policy, Affiliate Policy, Contact Us etc. and we do not what them to appear on our top page navigation menu and there is no option provided by wordpress when creating new page.

To solve this problem we need to manually change header.php file from our current theme folder.

How to apply:

  • Create a new page from wp-admin and publish it
  • Open header.php file located in the current theme folder to edit
  • Find the wp_list_pages function, add the argument exclude = id, where id is the id of the page that will be excluded. Use commas to separate each id if you want to exclude more than one pages, e.g. wp_list_pages ( ‘exclude = 15,18′).
  • To get the id of each page, go to the Edit Page menu, place the cursor on the edit link and get the id of the page found on the page url (wp-admin/page.php?action=edit&post=15).

That’s it now the excluded menu will not appear on the top navigation menu. You can add as many pages as you can without adding them in to navigation menu.