Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   [SOLVED] Page template with no menu (http://forum.bytesforall.com/showthread.php?t=20273)

prooffairy May 7, 2013 05:54 AM

[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

juggledad May 7, 2013 06:46 AM

you don't need a template, just some CSS like
HTML Code:

body.home #menu1 {display:none;}

prooffairy May 7, 2013 07:29 AM

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!)

juggledad May 7, 2013 10:35 AM

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.

prooffairy May 9, 2013 08:20 AM

"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?

juggledad May 9, 2013 01:53 PM

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.

prooffairy May 10, 2013 01:52 AM

Thanks ... really appreciate you taking the time to do this ... but .....

Followed your instructions exactly (except for the CSS inserts bit for adjusting the spacing), went into wordpress and there's a new page template called JUGGLEDAD's multi column/custom query. Selected that for my landing page. Not only is the menu still there but it's pulling through an extract of the blog posts to the page! Should be blank .....

http://www.max-inheritance.co.uk/landing-page/

juggledad May 10, 2013 02:25 AM

That templete has been probided with the theme since about 3.7.1.
If you followed the directions you should have a second templete called 'no menu'

prooffairy May 10, 2013 03:51 AM

I'#m using Atahualpa 3.7.12. In Appearance>Editor I can see the no-menu.php file but within the page section I only have default and the JUGGLEDAD one (which I've never noticed before - hence thinking it was the result of doing the above!)

Hmm ok ... so why is my no menu template not visible?

juggledad May 10, 2013 04:05 AM

should be working...if you send me a PM with an admin id/pw I'll take a peek

juggledad May 10, 2013 04:45 AM

go back and follow the directions exactly

prooffairy May 10, 2013 05:08 AM

OK thanks ... sorry, the instructions made it sound like I only needed to add the CSS Inserts bit to change the spacing - not that that bit was essential to make it show up!

So I have the no-menu template active ... but now there's a grey overlay where the menu would have been!

juggledad May 10, 2013 05:14 AM

that's from the CSS - you can change that to what ever color you want. it is there so the total header area is the same on pages with the menu and without. you could change it to 'transparent'

prooffairy May 10, 2013 05:38 AM

Thanks, fixed now - really appreciate your help!


All times are GMT -6. The time now is 06:19 AM.

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