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 »

Displaying a Title Above a Category Page


  #1  
Old Apr 6, 2013, 08:00 PM
vinceesq
 
32 posts · Jun 2011
Hello,

I am trying to add a title to the category page. Let's say I have 5 cats and upon clicking each category, I'd like to have a title for the category to display above all the posts in that specific category. Therefore, I will need 5 different titles to be displayed for each category.

I tried to search for a solution in the forums here, however, nothing really worked for me. I tried solutions found in this thread: http://forum.bytesforall.com/showthr...category+pages but as I am using the latest version of the theme, I can't use php inserts. I did try to create a new widget area in the central column and add a text widget as suggested, but that would add a blanket title to all category pages and pages, and I need the title to be category specific.

I also found this suggestion at wordpress.org support forum:

__________________________________________________ ________
in category.php (or in archive.php, if the former does not exist)

after:

<div id="content">

add a line like this:

<?php if( is_category() ) { ?><h1 class="entry-title full-title"><?php single_cat_title(); ?></h1><?php } ?>
__________________________________________________ ____________

I think it pulls the category Name and uses it as the Title for the specific category (which would work for me), but we don't have category.php or archive.php in Atahualpa, so I am not sure if this solution is of any use to us.

Are there any easy solution?

Thanks for looking into this for me.
  #2  
Old Apr 7, 2013, 06:30 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You might be able to copy the 'multi column/custom query' template and add some code to look to see if the category name changed (the code example you gave wouldn't to that) and get that to work.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Apr 7, 2013, 12:34 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by juggledad
You might be able to copy the 'multi column/custom query' template and add some code to look to see if the category name changed (the code example you gave wouldn't to that) and get that to work.
I am sorry to say this, but I truly do not understand the answer above.

Are you saying there is a code corresponding to categories that I can copy from the 'multi column/custom query' template and add it somewhere else in the theme (I can't see any category-related code , though); or, are you suggesting I should experiment with the codes I can find on the internet and add those to the template to see if they might work. If the latter is the case, could you please tell me why the code I found won't work (it looks fine to me; but, then, I am not a coder)? Should I be looking for something similar or totally different? Does this template accept php codes?

Thanks.
  #4  
Old Apr 7, 2013, 05:06 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you could duplicate the file 'template_multi_column_custom_query.php' - which is in the theme folder, and add your code to it, Then use this template in a page on your site.

If you don't understand how to do this and are not a coder, you might want to hire someone to do it for you if it is somthing that you have to have.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Apr 7, 2013, 08:27 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by juggledad
you could duplicate the file 'template_multi_column_custom_query.php' - which is in the theme folder, and add your code to it, Then use this template in a page on your site.

If you don't understand how to do this and are not a coder, you might want to hire someone to do it for you if it is somthing that you have to have.
Of course, I am not a coder. If I were a coder why would I come here and bug you with a solution? Tell me, why???

I guess what you are saying is that you know how to do it but won't tell me because you want to get paid for it. Correct? I think it's time for you to let us know the type of questions we can ask here for free and for a fee. That would be honest and would make things simple - for you and for us.

With regard to my question, I came here to ask you how to do it because none of the solutions I found on wordpress.org could be applied to Atahualpa because the theme does so many things in its own unique way that we are, the non-coders, can't even figure out where to begin. I read a lot of threads here, and I can see a lot of people struggling with the same issues.

Anyways, if it is still within the scope of the free support, please let me know if the following solution that I found on wordpress.org can be implemented with Atahualpa:

__________________________________________________ _________________________

Different Text on Some Category Pages

A slightly more complex possibility is that you want different text to display depending on which category page the visitor is viewing. Then you would add the "default" text to the main category.php file, and create special category-#.php files (with their own version of the text, as described in the Introduction) for each category that needs special text at the top.

This does however create a lot of files in your theme directory, and can be avoided using the following code OUTSIDE the loop:

<?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 some generic text to describe all other category pages,
I could be left blank</p>
<?php endif; ?>

This does the following. Checks to see if we are looking at Category A, if we are then show the first bit of text, but if we're not then check if we are looking at Category B. If we are then show that bit of text, and finally, if it is neither Category A or B, then show this default text.

__________________________________________________ _____________________

If it is applicable then please let me know which template I should use and what modifications I could possibly make to the code to have it work with Atahualpa.

Thanks
  #6  
Old Apr 7, 2013, 10:04 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
@vinceesq

It is sometimes difficult to know how to answer many of the questions and some, such as yours, are more complex. I believe Juggledad made the suggestion he did to hopefully point you in the direction of a solution because of the amount of time it might take to implement, test and write instructions.

I am not a coder so I can't suggest a coding solution but you could perhaps use the List Category Posts plugin to do what you want.
__________________
~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 Apr 8, 2013, 04:09 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
1) do I know exactly how to do what you want? - no
2) could I do it? - probably
3) was I soliciting a job? - heck no I've got better things to do
I gave you free advice, pointed you towards a solution - twice. Am I going to spend even a half hour of my time to code, test and document a solution and then hand to you? Let me ask you, would you come paint my shed, me a total stranger, for free because I ask you to? (if you answer yes I'll provide the paint)
__________________
"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; Apr 8, 2013 at 05:34 AM.
  #8  
Old Apr 8, 2013, 10:11 AM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
@vinceesq

It is sometimes difficult to know how to answer many of the questions and some, such as yours, are more complex. I believe Juggledad made the suggestion he did to hopefully point you in the direction of a solution because of the amount of time it might take to implement, test and write instructions.

I am not a coder so I can't suggest a coding solution but you could perhaps use the List Category Posts plugin to do what you want.
Thanks for the suggested plugin. At first glance, it doesn't do what I am looking for, but I'll have a closer look at it.
  #9  
Old Apr 8, 2013, 10:26 AM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by juggledad
1) do I know exactly how to do what you want? - no
2) could I do it? - probably
3) was I soliciting a job? - heck no I've got better things to do
I gave you free advice, pointed you towards a solution - twice. Am I going to spend even a half hour of my time to code, test and document a solution and then hand to you? Let me ask you, would you come paint my shed, me a total stranger, for free because I ask you to? (if you answer yes I'll provide the paint)
This is not the first time this question has been asked. The earlier threads discussing this issue here are useless because php inserts are no longer allowed.

Back to my question. As category.php and archives.php are hard-coded in Atahualpa in a way that we can't even see them, any solutions that one can find on wordpress.org are difficult to implement. Therefore, I am kindly asking you again: if I were to test the solution showing below, which of the Atahualpa's template should I use, and more specifically, where exactly in the template this code should be placed. Please see below.

__________________________________________________ _________________________

Different Text on Some Category Pages

A slightly more complex possibility is that you want different text to display depending on which category page the visitor is viewing. Then you would add the "default" text to the main category.php file, and create special category-#.php files (with their own version of the text, as described in the Introduction) for each category that needs special text at the top.

This does however create a lot of files in your theme directory, and can be avoided using the following code OUTSIDE the loop:

<?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 some generic text to describe all other category pages,
I could be left blank</p>
<?php endif; ?>

This does the following. Checks to see if we are looking at Category A, if we are then show the first bit of text, but if we're not then check if we are looking at Category B. If we are then show that bit of text, and finally, if it is neither Category A or B, then show this default text.

__________________________________________________ _____________________

Thanks.
  #10  
Old Apr 8, 2013, 10:45 AM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
There are many attributes you can add to the List Category Posts plugin shortcode. Given your example here is an idea of what you might have on a page.

HTML Code:
This is the text to describe category A
[catlist id=1 numberposts=10]

This is the text to describe category B
[catlist id=2 numberposts=10]
the catlist id would of course need to be changed as required and other attributes for whether excerpts, full posts, thumbnails, etc. will be shown.

You could also put a link to the category archive after the list of posts.
__________________
~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.
  #11  
Old Apr 8, 2013, 12:06 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
Therefore, I am kindly asking you again: if I were to test the solution showing below, which of the Atahualpa's template should I use, and more specifically, where exactly in the template this code should be placed. Please see below.
not being the theme developer, I'd have to dig thru the code to be able to answer that question for you.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #12  
Old Apr 8, 2013, 12:56 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
There are many attributes you can add to the List Category Posts plugin shortcode. Given your example here is an idea of what you might have on a page.

HTML Code:
This is the text to describe category A
[catlist id=1 numberposts=10]

This is the text to describe category B
[catlist id=2 numberposts=10]
the catlist id would of course need to be changed as required and other attributes for whether excerpts, full posts, thumbnails, etc. will be shown.

You could also put a link to the category archive after the list of posts.
Thanks for these suggestions. This is a great plugin, but I just simply need to have my 11 cats in the sidebar without the posts. What this plugin does in the sidebar, it lists posts from all or specific categories, and I don't need that. I just need the default cats widget, and from there I need to have a static title showing above once the visitor has been taken to the list of posts under the specific category.
Thanks again.
  #13  
Old Apr 8, 2013, 02:28 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You've kind of lost me. I thought you wanted to have a page that showed the posts from a particular category with a title at the top indicating the category. Now you are mentioning items in the sidebar.
__________________
~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.
  #14  
Old Apr 8, 2013, 05:55 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
You've kind of lost me. I thought you wanted to have a page that showed the posts from a particular category with a title at the top indicating the category. Now you are mentioning items in the sidebar.
Hm... I always said I wanted a STATIC Title to show above the category page, which lists all posts from a category. A category page is generated when a reader clicks on the specific category, which is normally in the sidebar as a widget, or used in the header area as a category menu. In both cases, when you click on the category, a page is generated showing posts from that particular category.

I never said I wanted to generated a list of posts from a category in a particular existing post or page.

I apologize if that wasn't clear. The two codes I suggested do exactly that... with other themes. In Atahualpa, we don't have category.php or archives.php. So, wordpress.org does have a solution but I don't know where to implement it in Atahualpa. Any ideas?
  #15  
Old Apr 8, 2013, 07:03 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
The Category Posts Lists plugin lets you add a shortcode to a page which will list posts from a particular category. The title of that page could be the category name.

So the steps would be.
  • Create a page titled with the name of the category
  • Put the Category Posts List shortcode with the necessary attributes on the page.
  • Create a menu of all the pages that you put the shortcode in
  • Add the custom menu widget in the sidebar
__________________
~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.
  #16  
Old Apr 8, 2013, 07:20 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Well now that you have explained your issue clearly, I spent some time and have a solution. What is my time and the answer worth to you?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #17  
Old Apr 8, 2013, 10:31 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
The Category Posts Lists plugin lets you add a shortcode to a page which will list posts from a particular category. The title of that page could be the category name.

So the steps would be.
  • Create a page titled with the name of the category
  • Put the Category Posts List shortcode with the necessary attributes on the page.
  • Create a menu of all the pages that you put the shortcode in
  • Add the custom menu widget in the sidebar
Well, thank you for this solution. I'll give it a try. My initial impression though with this plugin was that it would strip all images and links by default. However, the default cat page does pick up the featured image that I set up for each post and it does show links, and all within the first 55 words. So, I am happy how it looks with the default cat page - it's just that I need a static title above each category. But, thanks anyway.
  #18  
Old Apr 8, 2013, 11:01 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by juggledad
Well now that you have explained your issue clearly, I spent some time and have a solution. What is my time and the answer worth to you?
I am not sure what you are asking me about. You seemed to be outraged when I suggested you have been soliciting money. I refuse to play this game with you.

This is a question that many people would like to have answered, particularly because Atahualpa is so different from the default theme that we simply can't make use of the knowledge base available at the wordpress.org.

Now, if you are not the owner of the theme (as I thought you were), then I don't understand your role at this forum. This is a free theme and a free forum, so I am not sure why you are so bitter about not being paid for your help. You make me feel as if I am trying to extort a solution from you for which I should have paid in the first place. If you guys want to be paid for your support, I think you should address this issue with the theme developer. Make it a paid support only; or, divide the support into paid and non-paid versions, and communicate clearly with the members which questions will be for free and which ones for a fee.

Back to my original question: I'd like to try that code I found at wordpress.org but I don't know which theme template to use it in as category.php and archives.php are not in there. And, more specifically, does it matter where in the template?

If this question is within the scope of the free support, and I'd be grateful to you for the support (and that answers your questions re what's in it for you). If it's not, then please simply close this thread as unresolved.
  #19  
Old Apr 8, 2013, 11:12 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
Quote:
Originally Posted by vinceesq
Well, thank you for this solution. I'll give it a try. My initial impression though with this plugin was that it would strip all images and links by default. However, the default cat page does pick up the featured image that I set up for each post and it does show links, and all within the first 55 words. So, I am happy how it looks with the default cat page - it's just that I need a static title above each category. But, thanks anyway.
The attributes you can add to the shortcode will let you select a category or categories, show the full post or just an excerpt, show a thumbnail (or not) etc. etc. so if you want to show the title of a category and then under it show the post and or excerpts you would have the following on a regular page. Using this method will also not mess with the theme files and thus will survive an upgrade.

Category Title
[Shortcode]

Category Title
[Shortcode]
__________________
~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.
  #20  
Old Apr 9, 2013, 02:33 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
The attributes you can add to the shortcode will let you select a category or categories, show the full post or just an excerpt, show a thumbnail (or not) etc. etc. so if you want to show the title of a category and then under it show the post and or excerpts you would have the following on a regular page. Using this method will also not mess with the theme files and thus will survive an upgrade.

Category Title
[Shortcode]

Category Title
[Shortcode]
Thanks, Larry. I truly appreciate your help.

I gave the plugin my best try, however, I wasn't happy with the output. I have 21 posts in that particular category, and they were rendered in some sort of a cascading stile in groups of three on the page. Something like this:

Post 1
.......Post 2
.............Post 3

Post 4....

I think the layout is hard-coded into the plugin. I did manage to have a thumbnail image included, but some text in the excerpt has been skipped including an affiliate link.

I guess I am back to ground zero with my question. I have posted it on wordpress.org for Atahualpa support, so, hopefully someone will respond with a solution. Thanks again for your effort.
  #21  
Old Apr 9, 2013, 03:58 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
What was the shortcode you used?
__________________
~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.
  #22  
Old Apr 9, 2013, 10:13 PM
vinceesq
 
32 posts · Jun 2011
Quote:
Originally Posted by lmilesw
What was the shortcode you used?
This is the code I used:

[catlist id=11 numberposts=0 excerpt=yes excerpt_size=55 catlist thumbnail=yes catlist thumbnail_size=thumbnail]

I have some text with bullets, and a star rating (which is a shortcode), and an affiliate link within the first 55 words, and all of it has been skipped, going straight to the text after the bullets. Therefore, I am guessing, the plugin simply strips other shortcodes, links, and bullets from the output.

Looks like in my particular case, too many conditions needs to be met for the plugin to work for me.
  #23  
Old Apr 9, 2013, 10:32 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
There shouldn't be multiple catlist items in there. That only goes at the beginning.

I'm not sure about all the attributes but if they are correct the shortcode would be

[catlist id=11 numberposts=0 excerpt=yes excerpt_size=55 thumbnail=yes thumbnail_size=thumbnail]

Then you may have to use CSS to tweak the look and feel.
__________________
~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 prevent the title 'Home' displaying on the home page? kitfreeman Center area post/pages 0 Jan 28, 2011 01:41 PM
[SOLVED] Home page title not displaying ... edkopec Atahualpa 3 Wordpress theme 7 Oct 6, 2010 08:43 PM
'Read More' not displaying on custom category-posts-in-a-page maija Excerpts, Read more, Pagination 2 Mar 8, 2010 05:29 PM
Category title on category page, not on each post excerpt kicker paulae Excerpts, Read more, Pagination 4 Jun 22, 2009 12:33 PM


All times are GMT -6. The time now is 12:11 PM.


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