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 »

Placing widgets on pages


  #1  
Old Feb 11, 2009, 09:02 AM
mactony
 
67 posts · Jan 2009
Placing widgets on pages

This is more a general question, and I'm not sure if it falls under the atahualpa theme or not: is it possible to put widgets on a static page, not in a sidebar? I have widgets associated with various plug-ins that update themselves (for instance, a touring schedule for bands) and I would like that widget to appear on my static greeting page, in a specific location, and not in a sidebar. is it possible to create a table or div structure on my static home page and place the widgets into it with code?
  #2  
Old Feb 11, 2009, 04:43 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
See the top of functions.php on how widget areas are initialized. Repeat what's there for 2 sidebars for X additional sidebars:

Put this

PHP Code:
    register_sidebar(array(
        
'name'=>'The Title under which this sidebar will appear at Site Admin -> Widgets',
        
'before_widget' => '<div id="%1$s" class="widget %2$s">',
        
'after_widget' => '</div></div>',
        
'before_title' => '<div class="widget-title"><h3>',
        
'after_title' => '</h3></div><div class="widget-content">',
    )) 
before this:

PHP Code:

# Load functions 
This part

PHP Code:
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        
'after_widget' => '</div></div>',
        
'before_title' => '<div class="widget-title"><h3>',
        
'after_title' => '</h3></div><div class="widget-content">'
can also be

PHP Code:
        'before_widget' => '',
        
'after_widget' => '',
        
'before_title' => '',
        
'after_title' => ''
Those tags in the two existing sidebar setups are there for the sidebar widgets, you can leave them empty or add your own HTML tags. It's pretty self explanatory for what these tags are. before_title means before widget title. Many widgets such as the text widget don't need to have a title so there's also no need to wrap the title into some HTML tags.


Then put

PHP Code:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(X) ) : endif; ?>
wherever you want to have that widget area in the template. Replace X with the number of the widget area. 1 and 2 are already used for the 2 sidebars. If you put another one into functions.php, that would be the third, so you would replace X with 3.

To have the widget area only on the front page you'd also wrap it into a conditional statement

PHP Code:
<?php if ( is_front_page() ) { ?>
<?php 
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(3) ) : endif; ?>
<?php 
?>
Put that code into index.php, for instance above

PHP Code:
        <?php // Post Footer
to have the widget area above the Post Footer
  #3  
Old Feb 11, 2009, 05:49 PM
mactony
 
67 posts · Jan 2009
Whoa. This will take some absorption. But I am gonna give it a shot.

Thanks for the detailed explanation!
  #4  
Old Feb 11, 2009, 07:25 PM
mactony
 
67 posts · Jan 2009
Absolutely fantastic. Thank you so much for taking the time to put up that tutorial. So great.

My whole front page just became so much easier to control, the entire main section is now widgets.

http://www.midriffrecords.com/midriff_TEST

Is there a downside to widgetizing? Does it slow down a site in any horrible way? Thanks again!

tony
  #5  
Old Feb 11, 2009, 07:30 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
This should not slow down anything. But you would have to apply these file edits again if you ever were to update to a newer Atahualpa version. The current version is rather mature though and you could skip a few new versions if you see no problem with the current version.
  #6  
Old Feb 11, 2009, 07:51 PM
mactony
 
67 posts · Jan 2009
Once I get this site live it is staying the way it is until internet 4.0.



Thanks!

Tony
  #7  
Old Aug 6, 2009, 09:12 AM
conon
 
21 posts · Mar 2009
Hi,

I'm using Atahualpa 3.2 where I'm using three sidebar columns (left, middle, right) with widgets on the start page. I have some trouble with the margin and padding between the different sidebars when viewing another pages.

There's no problem when viewing the start page but when viewing another page there's a 15px left padding on the middle sidebar: http://bit.ly/aPvhq

And when viewing an entire page with only the middle sidebar i also got a 15px right padding: http://bit.ly/Yojxe

I understand it's because of the td#middle left/right-padding preference but I can't get the middle sidebar with margin on the right or left side on the start page without this preferences.

Any help Appreciated.

Best,
Sebastian
  #8  
Old Aug 6, 2009, 08:21 PM
OrganicAnalyticsNow
 
14 posts · Jan 2009
I am using Atahualpa 3.4.1 and WordPress 2.8.3.
We are trying to create a profile page with only 3 horizontally cell for widgets in the center column and no sidebars. We want the header and footer to stay the same, but for some reason we're having problems with setting it up, even with reading through the previous postings and still can't get it to work. Is this because the theme has been updated and something has changed?
  #9  
Old Jan 27, 2010, 06:48 AM
michael1
 
3 posts · Dec 2009
I tried placing the code shown in the function.php file.

I now have the following error...

Parse error: syntax error, unexpected '}' in /home/michae78/public_html/wp-content/themes/atahualpa/functions.php on line 63

Please Help!!!
  #10  
Old Jan 27, 2010, 10:44 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
please paste the code 10 lines before and after line 63. This looks like a syntax or typo error
__________________
"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; Mar 2, 2010 at 04:31 AM.
  #11  
Old Jan 27, 2010, 10:53 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Have you thought of just putting the new widget code into the ATO->Edit POST/PAGE INFO ITEMS->KICKER: "Page" Pages?
__________________
"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; Mar 2, 2010 at 04:29 AM.
  #12  
Old Jan 27, 2010, 11:16 AM
geektink
 
2 posts · Jan 2010
Atlanta, GA
Quote:
Originally Posted by juggledad
Have you thought of just putting the new widget code into the aot->Edit POST/PAGE INFO ITEMS->KICKER: "Page" Pages?
Could you please explain this in more depth?
Thanks in advance.
  #13  
Old Mar 1, 2010, 09:55 PM
georgiamarie
 
1 posts · Mar 2010
Quote:
Originally Posted by geektink
Quote:
Originally Posted by juggledad
Quote:
Originally Posted by geektink
Can you add center widgets to other pages besides the front page?

Have you thought of just putting the new widget code into the aot->Edit POST/PAGE INFO ITEMS->KICKER: "Page" Pages?
Could you please explain this in more depth?
Thanks in advance.
I think I have a similar request. I want the 'Archives' widget to be displayed in the main content column on a Page I have created called 'Archives' which also has some text on it.

I understand how to create additional areas to dump the widgets (eg sidebar 3 type thing) as explained earlier in tjhis thread. But I want to know if I can get this 'sidebar 3' to show up in the content area of one page, and one page only, that is not the front page.

Anyone know how?
  #14  
Old Mar 2, 2010, 04:44 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
there are several ways you can put a widget in the content area of a page
one way is to put a new widget area in the KICKER or BYLINE or FOOTER "Page" Pages area
you could also add it to the center area as explained in the New Widgits Option area

To only have the widget display on a single page, you will need to add eithor some logic to prevent the display on other pages or a CSS Selector to only display it on one page.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing cells within the pages of my site nickcee Atahualpa 3 Wordpress theme 14 May 22, 2009 01:13 AM
Problem Customizing Widgets on Different Pages davidferris Sidebars & Widgets 1 Apr 27, 2009 08:00 PM
Need help creating pages with custom settings and widgets Humphrey Sidebars & Widgets 1 Apr 21, 2009 09:14 AM
Widgets produce blank pages - how can I fix this? bjt1t2t3 Sidebars & Widgets 0 Mar 15, 2009 10:05 AM
Widgets on Pages (or not) Steve_T Sidebars & Widgets 3 Feb 10, 2009 08:13 AM


All times are GMT -6. The time now is 11:59 AM.


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