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 » Page & Category Menu Bars »

[SOLVED] Page template with no menu


  #1  
Old May 7, 2013, 05:54 AM
prooffairy
 
73 posts · Oct 2010
[SOLVED] Page template with no menu

I've built website but need to have a page template that has the menu missing (but everything else the same) that can be used as a standalone landing page. Obviously if I just delete the get_header command that will mess everything up ... is there any way I can set up something that pulls all the elements in except the actual menu itself?

Please go easy on me - I know dribs and drabs of CSS/PHP (thanks to working with Atahualpa so much!) but am not a natural coder!

The site is at www.max-inheritance.co.uk
  #2  
Old May 7, 2013, 06:46 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you don't need a template, just some CSS like
HTML Code:
body.home #menu1 {display:none;}
  #3  
Old May 7, 2013, 07:29 AM
prooffairy
 
73 posts · Oct 2010
Thanks ... is there no way to create a template though? The issue is that the client wants to be able to set up landing pages himself, so there will be more than one needing the menu-free layout. I saw a response that gave some CSS that used the page ID and that's fine, but I don't want him to have to dive into the ATO CSS Inserts section every time he wants to add a new landing page - it would be far easier if I could have a completely separate template he could choose from the editing page.

(Also the way the page is set up means without the menu displaying there are a few glitches in the background etc - which I would hopefully be able to iron out in a separate template!)
  #4  
Old May 7, 2013, 10:35 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The problem is that the menu is in the header and index.php calls get_header() which goes thru other code to build the whole header (bfa_header_config.php). Now I suppose you could get the content of the header configuration ($bfa_ata['configure_header']) and parse it removing the %pages, %page-center or %page-right depending on which is used (oh and don't forget the %cats) right befor the call to get_header() that might work.
  #5  
Old May 9, 2013, 08:20 AM
prooffairy
 
73 posts · Oct 2010
"Parse" ......? You've lost me I'm afraid!

maybe I will just have to set up some blank pages he can add copy to and use their ID to remove the menu in CSS Inserts.

The problem I have is that the header image moves up the page when the menu isn't there ... see the home page http://www.max-inheritance.co.uk/ and the one landing page I made at http://www.max-inheritance.co.uk/landing-page/ ..... the logo ends up overlapping the strip along the top. How can I stop that happening please?
  #6  
Old May 9, 2013, 01:53 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
well this got me thinking and I have come up with a hack that works...but will be unsupported and you will have to reinstall it after each upgrade

1 - create your template
- make a copy of 'index.php' and call it 'no-menu.php'
- edit 'no-menu.php' and change lines 1-3 from
HTML Code:
<?php 
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
get_header(); 
to
HTML Code:
<?php
/*
Template Name: no menu
Version: 1.0

LICENSE:

   "no menu" is a template for the Atahualpa theme 
   Copyright (C) 2013 Paul M Woodard, The User's Guru (www.theusersguru.com)

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   For a copy of the GNU General Public License go to 'www.gnu.org/licenses'
   
*/
 ?>
<?php 
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();
global $bfa_pagetemplate_name;
$bfa_pagetemplate_name = 'no-menu.php';

get_header(); 
2 - edit bfa_header_config.php (this is in the 'functions' subfolder of the theme)
- change lines 4-16 from
HTML Code:
	global $bfa_ata, $post;
	$templateURI = get_template_directory_uri(); 
    $homeURL = get_home_url();  

	// Since 3.6: bfa_header_config() instead of bfa_header_config($header_items)
	$header_items = $bfa_ata['configure_header'];
	
	$page_menu_bar	= ''; 		$cat_menu_bar	= '';  		$logo_area	= '';  
	$header_image	= '';  		$horizontal_bar1	= ''; 	$horizontal_bar2	= ''; 

	// Page Menu Bar
	if ( strpos($header_items,'%pages') !== FALSE OR strpos($header_items,'%page-center') !== FALSE 
	OR strpos($header_items,'%page-right') !== FALSE ) {
to
HTML Code:
	global $bfa_ata, $bfa_pagetemplate_name, $post;
	$templateURI = get_template_directory_uri(); 
    $homeURL = get_home_url();  

	// Since 3.6: bfa_header_config() instead of bfa_header_config($header_items)
	$header_items = $bfa_ata['configure_header'];
	
	$page_menu_bar	= ''; 		$cat_menu_bar	= '';  		$logo_area	= '';  
	$header_image	= '';  		$horizontal_bar1	= ''; 	$horizontal_bar2	= ''; 

	// Page Menu Bar
	if ( ( strpos($header_items,'%pages') !== FALSE OR strpos($header_items,'%page-center') !== FALSE 
	OR strpos($header_items,'%page-right') !== FALSE ) AND ($bfa_pagetemplate_name !== 'no-menu.php') ){
at this point you are set other than maybe some customizing in the css insert to keep the space taken by the menu. You can do that by adding something like this (this assumes you have the image following the menu in the header configuration) to ato->Add HTML/CSS Inserts->CSS Inserts
HTML Code:
body.page-template-no-menu-php #imagecontainer {border-top: 37px solid #eeeeee;}
Hope this helps.

Bookmarks

Tags
menu, page template

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Add Page Menu to Dump Template pvelte Page & Category Menu Bars 6 Dec 4, 2012 05:50 PM
Custom Page Template Alters Page Order In Menu Bar RichardG Page & Category Menu Bars 1 Sep 8, 2011 04:31 AM
Create a Page Template that displays Only One Page Menu Item treeplant Page & Category Menu Bars 0 Apr 20, 2010 02:41 AM


All times are GMT -6. The time now is 07:56 PM.


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