Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

Template-Specific Widgets (end user in mind)


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Dec 14, 2009, 09:07 PM
Dockery
 
6 posts · Sep 2009
================================================== =================
= see http://forum.bytesforall.com/showthread.php?t=13352
= and 'HOWTO: create a 'no sidebar' template (or 1, 2, 3 or 4 sidebar template)' in the Gold Forum Tutorials
================================================== =================


Using the method set down by Flynn to create different page templates ( see: http://forum.bytesforall.com/showthread.php?t=711 ) I was able to make 2 new templates. How can I remove the sidebar from one template completely for a wider page?

They will probably use the wide template many, many times, and ALSO keep the widgeted page many times. I looked into widget logic, but as the end user starts adding page after page to his blog, he will probably *Forget* how to add these changes to the widgets and get angry with me.

Is there a solution where I can simply remove the entire sidebar set from one of these template pages? for example can I make a copy of the footer (footer2.php) which removes the code for the sidebar and then access that file ONLY through one of these template pages?

Many Thanks in advance!

Last edited by juggledad; Jul 18, 2011 at 09:52 AM.
  #2  
Old Dec 15, 2009, 04:42 AM
juggledad's Avatar
juggledad
 
21,935 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
each page you create has a page ID. In the sidebar styling options, there is an option to exclude the sidebar by page id. It also explains how to find the ID.
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #3  
Old Dec 15, 2009, 08:07 AM
Dockery
 
6 posts · Sep 2009
Every time they created a page, would they then have to find the page ID, and make the adjustment, or Is this an adjustment I can make for the template page and not have to worry about them getting confused for?

Where can I make that adjustment? Thanks!
  #4  
Old Dec 15, 2009, 09:59 AM
juggledad's Avatar
juggledad
 
21,935 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
yes you would have to do it for each page.

This is a wordpress issue. A template is nothing, just that, it is a TEMPLATE. It doesn't really become part of wordpress untill someone creates a PAGE. This PAGE has an ID that can be styled.

Atahualpa is a theme that works on the posts and pages that exist within wordpress. The template doesn't exist within the WordPress database, so the theme doesn't know about it.

You can create a page with a template and then remove the template, but the page still exists and this is what Atahualpa works with.

If you want to dig thru the code, you may find a way of doing it.
__________________
If you like my help, please consider donating. I am happy to provide greater detail on this and other topics if you hire me. Please send detailed support requests to me as a private message, thank you.
Juggledad | Forum Moderator/Support
  #5  
Old Dec 16, 2009, 12:57 PM
Adam
 
10 posts · Jul 2009
Boston, MA
I have limited success with the template-specific sidebars, but I've only gotten it to work for DISPLAYING sidebars that normally are turned off.

Step One:
Because the sidebars are not created in the Main Index Template, but rather in the Header and Footer files, I had to first combine them all into on new page template file. Lets call it SpecialPage.php

Step Two:
Go into SpecialPage.php and find the code block for the sidebar you want to turn on.
Change the line that looks like:

PHP Code:
<?php if ( $bfa_ata['right_col'] == "on" ) { ?>
to:

PHP Code:
<?php if ( == ) { ?>
This turns on that sidebar when that template is in use.

Step Three:

The header needs to know how many columns are underneath it to display correctly. Usually it calls a function to check what sidebars are being displayed and figures it out from there. Step two just screwed up it's ability to do that. So, since you know how many columns there are underneath, just tell it.

Find:

PHP Code:
<td id="header" colspan="<?php echo $bfa_ata['cols']; ?>">
and change it to:

PHP Code:
<td id="header" colspan="X"
with X being the total number of columns turned on for pages using this template.


So...
That works.


But now I have a problem-
I can't do the opposite-
turn OFF specific sidebars.

I tried doing exactly what I described herein, but telling them to turn off by changing the IF statement to IF 1=2. This almost works, but not quite. It screws up layout:

When i use this hack to REPLACE one sidebar with another (usually "Right" displays, but for SpecialPage I want "Right-inner") the right inner sidebar displays, with right inner sidebar content... But with the Width of the right sidebar.

I CANNOT figure out what is causing this. It seems really weird to me.
I even tried changing the ID of the that SpecialPage sidebar, and then styling it specifically in CSS. No such luck. My browser knows that width is supposed to be X (according to Chrome's "Inspect Element" tool), but it displays as Y.


Also- if I normally only have one sidebar on, but want to turn on an additional sidebar for SpecialPage, it pushes the sidebar content out of the layout container like it doesn't have room for it.

In both of these instances, it's acting as if the center content column has a fixed width that won't expand or contract, and my right sidebars just have to deal with it.

Note- the "it works" stuff was all with the left sidebars, and the "WTF" stuff was all with the right sidebars.
  #6  
Old Dec 17, 2009, 12:11 PM
Adam
 
10 posts · Jul 2009
Boston, MA
Some updates...

I figured out my problem, and realized part of the answer was something that I did originally, but since have forgotten to do.

Near the top of the body, the theme generates several columns. These are turned on or off based on whether the ATO settings. But if you're trying to creating Template specific sidebars, you can't forget to toggle them on or off yourself.

The code looks like:

PHP Code:
<colgroup>
<?php if ( $bfa_ata['left_col'] == "on" ) { ?><col class="colone" /><?php ?>
<?php 
if ( $bfa_ata['left_col2'] == "on" ) { ?><col class="colone-inner" /><?php ?>
<col class="coltwo" />
<?php if ( $bfa_ata['right_col2'] == "on" ) { ?><col class="colthree-inner" /><?php ?>
<?php 
if ( $bfa_ata['right_col'] == "on" ) { ?><col class="colthree" /><?php ?>
</colgroup>
You need to match which ones you're turning on/off with which sidebars you want to turn on/off in the body.

Doing that allowed me to have one sidebar that I show on normal pages (in my case, "Right") and then on Special pages, I show the other three.- But I don't have to go into ATO every time I create a new page of that type. As long as I (or the client) selects the right template, everything works.

And if you needed to create additional sidebars that showed up on different templates, that wouldn't be too difficult either, as long as you remember the general format.


Oh, also-
There's a colspan in the footer you have to adjust as well, otherwise your footer gets confused.

PHP Code:
<!-- Footer -->
<td id="footer" colspan="<?php echo $bfa_ata['cols']; ?>">
needs to be

PHP Code:
<!-- Footer -->
<
td id="footer" colspan="X"
again, X= the total number of sidebars you want displayed on that template.


Hope that helps some other people.
  #7  
Old Dec 17, 2009, 07:39 PM
Dockery
 
6 posts · Sep 2009
Wow, that is some deep delving!

I'll be giving that a try. THanks!

Bookmarks

Tags
no sidebar on some pages, no sidebar one page, no widgets on some pages, remove sidebar, remove widgets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to put specific SWF files on specific pages as header images? kippiper Header configuration & styling 2 Dec 10, 2009 08:23 AM
How to add CUSTOM widgets to specific pages only cab262 Sidebars & Widgets 1 Dec 9, 2009 10:42 AM
How to add widgets to specific page IDs through the Atahualpa Theme Options area? cab262 Sidebars & Widgets 2 Dec 9, 2009 07:52 AM
collapsible sidepost widgets of specific category angmarianne Forum How-To 0 Nov 9, 2009 08:17 AM
Can't make up your mind re: background color? paulae Atahualpa 3 Wordpress theme 3 Apr 11, 2009 10:04 PM


All times are GMT -6. The time now is 01:20 AM.


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