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 » Sidebars & Widgets »

Using ATA Custom Field to turn off sidebars


  #1  
Old Jun 17, 2015, 02:10 PM
riw777
 
33 posts · Jun 2009
Y'all --

I know this bit of code:

if ($bfa_ata['left_col_pages_exclude'] != "") {
$pages_exlude_left = explode(",", str_replace(" ", "", $bfa_ata['left_col_pages_exclude']));
if ( isset($bfa_ata['leftcol_on']['page']) AND !in_array($current_page_id, $pages_exlude_left) ) {
$cols++; $left_col = "on";
}
} else {
if ( isset($bfa_ata['leftcol_on']['page']) ) {
$cols++; $left_col = "on";
}
}

Controls whether the left sidebar is displayed or not. I can reverse this, of course, but I'd actually like to be able to do something a little different -- I'd like to set it up so the presence of an ATA custom class or variable attached to the page controls whether or not the sidebars are shown. I use this theme on a college site with 100 pages already, and now that I'm moving the entire catalog online, I'm bound to be adding a few more. Listing pages individually to add or remove the sidebars from is getting really difficult, to be honest. A variable, or the ability to use a category (I've tried this and it doesn't work), would be really nice.

Thoughts?
  #2  
Old Jun 17, 2015, 02:32 PM
riw777
 
33 posts · Jun 2009
Looking at bfa_get_options.php, it looks like the easiest thing to do might be to remove all of the if/elseif stuff around what type of page this is, etc., and just leave the code for categories. So remove everything from:

if (( is_page() AND !is_front_page() AND !is_home() )
OR (function_exists('is_bbpress')) ) {
...
} elseif ( is_category() ) {

Leave the inner section of the is_category section, and take out the final "else" as well... This would disable all the "don't display on" controls on the settings pages other than the "don't display on category," section. I would need to do this each of the four sidebars in bfa_get_options, from what I can tell.

This would leave the control of whether or not to display a particular sidebar completely in the hands of each page or post being in the right category.

Would this work, or am I missing something here/making a mess of things?

Thanks!

Russ
  #3  
Old Jun 17, 2015, 03:05 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The thing is, you don't assign categories to pages....that code will remove the sidebar of a 'category' page - i.e. when you click on category 'x' and it shows a category page of all the posts in that category, then the sidebar won't show on that page
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jun 17, 2015 at 03:18 PM.
  #4  
Old Jun 17, 2015, 03:23 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
see this thread to make a page template for something like what you want
HOWTO: create a 'no sidebar' template (or 1, 2, 3 or 4 sidebar template)

change the code
HTML Code:
$left_col ="off";
$left_col2 = "off";
$right_col2 = "off";
$right_col = "off";
to what you want, name teh template and use it on the pages you want.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 17, 2015, 03:28 PM
riw777
 
33 posts · Jun 2009
Quote:
Originally Posted by juggledad
see this thread to make a page template for something like what you want
HOWTO: create a 'no sidebar' template (or 1, 2, 3 or 4 sidebar template)
Aha! I hadn't thought of using a template for all the pages. I'll try that.

Thanks!
  #6  
Old Jun 17, 2015, 06:12 PM
riw777
 
33 posts · Jun 2009
One other question -- when I use the template, it leave the space for the sidebar... I'm pretty certain this is td#middle on that page, but is there some way to modify the new php to force the middle to go 100% width within the wrapper? Or do I need to this with custom css per page?

Thanks!

:-)

Russ
  #7  
Old Jun 17, 2015, 07:30 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Hmmm my version of the template doesn't - did you make the change to header.php as it says in the thread?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Jun 17, 2015, 09:18 PM
riw777
 
33 posts · Jun 2009
This is what I have --

<?php
/*
Template Name: nosidebar
*/
?>
<?php
list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();

$left_col ="off";
$left_col2 = "off";
$right_col2 = "off";
$right_col = "off";

get_header();
extract($bfa_ata);
global $bfa_ata_postcount;
?>


And this is the resulting page --

https://shepherds.edu/about-shepherd...effectiveness/

It looks like the page text ends just where the sidebar should start... I was thinking it might want to make the middle column of the layout table what it was without the sidebar, but I'm not certain.

Thanks!

:-)

Russ
  #9  
Old Jun 17, 2015, 09:22 PM
riw777
 
33 posts · Jun 2009
Aha -- I found it -- I didn't do the header.php file correctly.

Thanks!

:-)

Russ

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying a custom field? emanuel1969 Montezuma Theme 4 Jun 28, 2013 01:03 PM
Show custom field in kicker - only IF field value exists jaxon Center area post/pages 13 Feb 6, 2013 02:11 PM
Unable to turn off sidebars harty Sidebars & Widgets 1 Nov 17, 2011 04:25 AM
Custom field image with custom field link mbastos Atahualpa 3 Wordpress theme 1 Jul 1, 2010 09:17 AM
How to turn of the form/text field shadow? Fux Atahualpa 3 Wordpress theme 2 Apr 27, 2009 09:06 PM


All times are GMT -6. The time now is 09:39 PM.


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