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 » Center area post/pages »

Where to put php template tags?


  #1  
Old Feb 5, 2013, 02:44 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Hi. I just started using a plugin that allows me to assign a unique image to each of my categories, and then use a template tag to display that image within a post (anywhere inside the loop). I want to display it in the kicker or byline area, but we're not allowed to put php in the theme options. Here's the tag I want to use:

<?php c2c_the_category_image(); ?>

Where should I put this to make the image appear in the kicker or byline area?

Thanks!
__________________
Emanuel
http://www.sferios.com
  #2  
Old Feb 5, 2013, 03:40 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You could put the code for a new widget area in the kicker box and then add your code using a php aware widget.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Feb 5, 2013, 04:00 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Is that a special kind of widget? Do I need a plugin for that?

But also, isn't there a place within the Atahualpa files where I could add it?
__________________
Emanuel
http://www.sferios.com
  #4  
Old Feb 5, 2013, 04:40 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I don't remember the name of the plugin off hand but if you do a search on wordpress.org it shouldn't be hard to find. I would add the new widget area code to the kicker box. If you add it to a theme file it will get overwritten with a theme upgrade. The only time I edit theme files is when there is a patch.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Feb 5, 2013, 08:26 PM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Well according to the instructions in the "Add New Widget Area" section, the only way to add a widget area to the center column is to edit a theme file. Here is what it says:

"Style & edit CENTER COLUMN: If you want to add a widget area to the Center Column, you must edit "index.php" in the theme folder and add the widget area code there."

Interestingly, just below that it says:

"Technically, you could also hard code widget areas into one of the Atahualpa files such as index.php, header.php or footer.php (by using the code as shown below). You should avoid this though, because you'd have to re-do these file edits whenever you upgrade to a new version of Atahualpa."

So if I have to edit the theme file anyway, I might as well just post the php tag directly, right? This saves a step rather than hardcoding a widget area, installing a php compatible text widget, and then putting the php tag in the widget.

Or am I missing something?

And lastly, I actually have been able to make the image appear by putting the php tag right in the index.php file, either just above or just below the kicker box. But if I wanted to make it appear *inside* the kicker box, on the same line, that is, with the rest of the kicker, where would I put the tag? Here is the tag:

<?php c2c_the_category_image(); ?>

And here is the kicker box tag inside the index.php file (along with the line just below it):

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>
<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
__________________
Emanuel
http://www.sferios.com
  #6  
Old Feb 5, 2013, 09:22 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I would add the new widget code to one or all of the kicker boxes in the "Edit Post/Page Info items" section of the theme options. Then I would install this plugin which provides a widget where you can put php code.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #7  
Old Feb 6, 2013, 12:03 AM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Ok well just to be sure here... you are telling me to ignore the instructions in Atahualpa itself. The instructions clearly say this:

"If you want to add a widget area to the Center Column, you must edit "index.php" in the theme folder and add the widget area code there."

I'll give it a try.
__________________
Emanuel
http://www.sferios.com
  #8  
Old Feb 6, 2013, 12:57 AM
emanuel1969's Avatar
emanuel1969
 
133 posts · Apr 2010
California
Send a message via Skype™ to emanuel1969
Well it's working with one exception. I put new widget code in all three kicker boxes (home page, multi-post pages and single-post pages), but my new widget areas are only appearing in two of them. It is not appearing in multi-post pages. I have refreshed and refreshed many times.

That said, the plugin you gave me works fine. So all is well except I can't get that third widget area to appear.

BTW, I added three different new widget areas, meaning they all have different names. I did not put the same new widget code into all three kicker boxes. Was that correct?
__________________
Emanuel
http://www.sferios.com
  #9  
Old Feb 6, 2013, 12:14 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I would put the same widget area code in all the boxes.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How To Change H1 Tags On Pages - Can't Find Page Template In Code pokepsw Center area post/pages 7 Feb 7, 2011 12:29 PM
How to convert Atahualpa 3 columns template into 2 colums template? phboujon Page & Category Menu Bars 3 Jun 7, 2010 05:05 AM


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


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