adsense

How to Remove Navigation on Certain Wordpress Page Templates





1. Navigate to the folder containing your WordPress files. Go to 'wp-content' first and then look in the 'themes' folder for the folder of your current theme. Open the PHP files for the theme within a code editing program such as Notepad , jEdit or BBEdit. Each PHP file, with the exception of 'functions.php' and any file it references, is a template page.
2. Find the template page you wish to edit. For example, if you want to remove the menu from the first page of your blog, then you need to edit 'home.php'. The 'single.php' file controls how a single post is displayed, and 'page.php' controls static pages. Static front pages use a file called 'front-page.php' to display content. If your theme is missing a file such as 'home.php' or 'front-page.php' you can create it by copying and pasting code from either the 'page.php' or 'index.php' templates.

3. Look for the following code:
Though you may see more code between the parentheses, this is the basic 'template tag' or built-in PHP function WordPress uses to display menus. You can remove this function by deleting the code, but a better way is to 'comment it out' by placing 'comment' marks in front of the function, like so:

4. Use conditional tags if you want to display the menu in some situations and hide it in others. For example, if you want to hide the menu on a page titled 'Simple Page,' use this code:


WordPress uses special functions called 'conditional tags' to check for different situations, such as the user visiting the front page or a static page. The exclamation here stands for 'not' as in, 'If the page is not 'Simple Page' then display the menu.'

Comments

0 Responses to "How to Remove Navigation on Certain Wordpress Page Templates"

Post a Comment

Popular Posts

About