Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

[SOLVED] Remove menu(s) from custom template


  #1  
Old May 23, 2012, 10:51 AM
cabdziner
 
22 posts · Feb 2011
Using ATA 3.5.3 and current version of Wordpress.

The site I am working on uses the page menu and cat menu (wp-menu system) on the static front page only (the cat menu is being used as a second page menu).
All other pages use a sidebar menu.
There is no blog page or posts... only pages.

My client wants a "template" for future pages. I created a page template using the index.php and just gave it a unique name.

The problem is... the template calls the page and cat menu and I don't want the client to have to use the custom css codes to eliminate the menu(s) every time they create a new page.

What php code would I place in the custom template to remove both menus?

Thanx in advance for any help.

Here is the template code:
Code:
<?php
/*
Template Name: Town template
*/
?>
<?php 	/* get all options: */
# error_reporting(-1);
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
global $bfa_ata;
get_header(); ?>
<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] = 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

	<?php /* This outputs the next/previous post or page navigation. 
	This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
	bfa_center_content($bfa_ata['content_above_loop']); ?>

	<?php /* The LOOP starts here. Do this for all posts: */
	while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>
	
		<?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
		$odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' : 'even-post' ); ?> 

		<?php /* This is the actual Wordpress LOOP. 
		The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
		bfa_center_content($bfa_ata['content_inside_loop']); ?>

						
	<?php /* END of the LOOP */
	endwhile; ?>

	<?php /* This outputs the next/previous post or page navigation and the comment template.
	This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
	bfa_center_content($bfa_ata['content_below_loop']); ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

<?php endif; /* END of: If there are no posts */ ?>

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>
  #2  
Old May 23, 2012, 11:50 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
First thing I would do is upgrade to 3.7.7 and make sure every thing is working. The index.php has changed so the templates will have to change too.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old May 23, 2012, 01:56 PM
cabdziner
 
22 posts · Feb 2011
Thanks for replying.

I do not want to upgrade from 3.5.3. There are quite a few custom widgets in use along with a ton of custom css.

The client wanted their original site replicated with a few functionality and layout tweaks.
Old site - http://www.securitypest.com/
New site - http://securitypest.wordpressproservices.com/

I have been using 3.5.3 for a while now and it is easier to just cruise through it rather than getting used to a new version, applying fixes, etc.

I was hoping someone might know the proper php to simply remove the menus from the template.
  #4  
Old May 23, 2012, 02:50 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you could always add some CSS and key off the 'body.templatename' and then the menu you want to hide with a 'display:none;'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old May 23, 2012, 03:07 PM
cabdziner
 
22 posts · Feb 2011
PERFECT!

I should have thought of that.

Thanks Juggledad.

Here is what I did - I added this to the css inserts...

Code:
body.page-template.page-template-town-template-php #menu1 {display:none}
body.page-template.page-template-town-template-php #menu2 {display:none}
Works like a charm.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove menu from appearing on certain pages; also custom header Eric Bobrow Page & Category Menu Bars 1 May 16, 2012 10:15 PM
Custom Page Template Alters Page Order In Menu Bar RichardG Page & Category Menu Bars 1 Sep 8, 2011 05:31 AM
Creating custom post template paulae Atahualpa 3 Wordpress theme 3 Mar 18, 2009 11:36 AM


All times are GMT -6. The time now is 12:19 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.