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 »

[SOLVED] How to have page title for category pages?


  #1  
Old Jul 21, 2010, 07:40 PM
JFG
 
44 posts · Jul 2009
Canada
Hi,

I would like to display the name of the category at the top of each category page, anyone know how I can do that?

Using Atahualpa 3.5.3
  #2  
Old Jul 21, 2010, 09:09 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
There is nothing built into Atahualpa for that but you could search the plugins at WordPress.org or try to figure out how to code something to put in the center column above the loop.
__________________
~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 Jul 22, 2010, 04:20 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You could also add some php to Ato->Style &edit CENTER COLUMN->Content ABOVE The LOOP to test if you are on a category page and if so, pump out the HTML to display the category name.

Take a look at the Wordpress codex or do a google search with 'wordpress is_category' to see how to use the conditional function
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Jul 23, 2010, 08:49 AM
JFG
 
44 posts · Jul 2009
Canada
Thanks for your replies.

What I have done is this : added a center widget area, and through a php widget added this code :

PHP Code:
<?php if (is_category('Category A')) { ?>
<p>This is the text to describe category A</p>
<?php } elseif (is_category('Category B')) { ?>
<p>This is the text to describe category B</p>
<?php } else { ?>
<p>This is the text to describe all other categories</p>
<?php ?>
but it is not automatic and a bit lengthy

I also tried this code :

PHP Code:
<?php
foreach((get_the_category()) as $category) { 
    echo 
$category->cat_name ' '

?>

but this actually displays the names of all categories associated with the latest post on the category page - not what I want to do.

What would I have to modify in the second example to display the name of the category page currently being displayed and not refer to the posts excerpts shown on that page?

Any help much appreciated,

JF
  #5  
Old Jul 23, 2010, 09:19 AM
JFG
 
44 posts · Jul 2009
Canada
Actually it was all more simple than the code in my last post.

So if anyone wants to do display the category name at the top of the category page, here's how I did it:


1. I added a center widget area in Atahualpa

2. I installed the PHP code plugin and Widget Logic plugin

3. I added a php widget in the center widget area with this code inside it : <?php single_cat_title(); ?>

and in that same widget, I added this condition in the Widget Logic box : is_category()

Voila!

Thanks to lmilesw and juggledad for pointing me in the right direction

JF

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to remove the category pages title? ahc Excerpts, Read more, Pagination 4 Dec 27, 2009 11:43 AM
[SOLVED] Post title fonts on category pages pushkinpassey Post-Kicker, -Byline & -Footer 2 Oct 1, 2009 09:38 AM
Change Category page title horsemansarts Atahualpa 3 Wordpress theme 3 Aug 25, 2009 05:53 PM
category pages - with just the linked title, author, date of each related post janey73 Atahualpa 3 Wordpress theme 2 Jun 25, 2009 01:11 PM
Category title on category page, not on each post excerpt kicker paulae Excerpts, Read more, Pagination 4 Jun 22, 2009 11:33 AM


All times are GMT -6. The time now is 03:38 AM.


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