Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

%category-linked% bug? It don't display the first assigned category for a post.


  #1  
Old Mar 30, 2010, 04:57 AM
conon
 
21 posts · Mar 2009
There seem to be problem with %category-linked% or %category%. It don't display the first category a post belongs to as it should for me.

I would like to display 1 category in the Byline and I need it to be the first category assigned to the post or alternatively exclude a specific category to be shown in the byline.

I use a 'Featured' Category that I assign to posts that I want to feature in Dynamic Content Gallery but I don't want the featured category to be displayed in the Byline. It should display the other Category (News, Post etc) that a post belongs to instead.

I have tried with this code in bfa_postinfo.php without luck:
PHP Code:
// 1st category, linked
    
if ( strpos($postinfo_string,'%category-linked%') !== FALSE ) {
        
$all_categories get_the_category(); 
        
//Default to first category
       
$categoryIndex 0;
       
       
//If first category is "Featured", select second category
       
if ($all_categories[$categoryIndex] == 10)
           
$categoryIndex 1;
        
$category $all_categories[$categoryIndex]->cat_name;
        
$category_linked '<a href="' get_category_link($all_categories[$categoryIndex]->cat_ID) .
        
'">' $category '</a>';
        
$postinfo str_replace("%category-linked%"$category_linked$postinfo);
    } 
I would appreciate any hint or help

Thanks

I use Atahualpa 3.4.6
Link to site: http://bit.ly/aTa8yB
  #2  
Old Mar 30, 2010, 05:37 AM
juggledad's Avatar
juggledad
 
23,576 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
can you gie some more detail.
Please list an example of a post and all it's categories and the category that is showing up.

try this, add '%categories(', ')%' to the kicker and
add '%category-linked%' to the byline
the first category listed in the kicker should be in the byline.

categories list in alphabetical order
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Mar 30, 2010, 05:59 AM
conon
 
21 posts · Mar 2009
Thanks Juggledad.

I have three categories: News, Blog, Featured. All posts got the categories News or Blog before they got assigned to the Featured Category. I tried your suggestion with listing all categories for a post and Featured was listed as the first Category for all posts that also got the 'News' category, but not for the 'Blog' category.

Anyway. I friend helped me with a workaround code below so it excludes my Feature category. So I'm happy now but it still doesn't work as it should do for me with the %category-linked%.

I have no idea if this might have something to do with that I have imported posts, pages, categories etc from an old installation.

Thanks!

PHP Code:
// 1st category, linked
   
if ( strpos($postinfo_string,'%category-linked%') !== FALSE ) {
       
$all_categories get_the_category(); 
       
//Default to first category
      
$categoryIndex 0;
      
      
//If first category is "Featured", select second category
      
if ($all_categories[$categoryIndex]->cat_ID == 10)

          
$categoryIndex 1;
$category $all_categories[$categoryIndex]->cat_name;
       
$category_linked '<a href="' get_category_link($all_categories[$categoryIndex]->cat_ID) .
       
'">' $category '</a>';
       
$postinfo str_replace("%category-linked%"$category_linked$postinfo); 

Bookmarks

Tags
byline, categories, category, featured

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Display post title only of a category in a page ladylulu Page & Category Menu Bars 9 Mar 1, 2011 09:02 AM
[SOLVED] Edit Wordpress Category Page to just display Post titles??? dennis wilson Excerpts, Read more, Pagination 8 Mar 3, 2010 05:52 PM
Category Page Listing - How to display: Post Title only TotalBalance Excerpts, Read more, Pagination 16 Jan 27, 2010 01:22 PM
[SOLVED] Category / Archive display problem with category menu bar madfab685 Page & Category Menu Bars 4 Jan 2, 2010 05:12 AM
category pages - with just the linked title, author, date of each related post janey73 Atahualpa 3 Wordpress theme 2 Jun 25, 2009 02:11 PM


All times are GMT -6. The time now is 10:18 PM.


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