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 » Post-Kicker, -Byline & -Footer »

[SOLVED] PostKicker or Byline only in some posts?


  #1  
Old Jun 3, 2011, 04:23 PM
sanguango
 
25 posts · May 2011
Hello, I've been looking for an answer to my question in the forum but I couldn't find it. I was wondering whether it is possible to show the PostKicker or the Byline only in some posts.

Let's say I have two type of posts: "news" and "places to visit". I want the "news" to show only the date and I want the "places to visit" to show only the address (assume I enter the address as a custom value). Is there any way to do this?

Thank you again in advance!
  #2  
Old Jun 3, 2011, 07:29 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
yes, in 3.6.7 you can edit index.php and add a conditional php statement to test for the category you want and make the TRUE portion the code that displays the byline.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 3, 2011, 11:37 PM
sanguango
 
25 posts · May 2011
I have no idea how to do that. What should I exactly do? Is there any place where I could learn to do that? I apologize for so many questions, I'm new with this!
  #4  
Old Jun 4, 2011, 04:05 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
To learn the various wordpress conditional tags, you can go to http://codex.wordpress.org/Conditional_Tags
to learn php you can do a google search 'php tutorial'
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 5, 2011, 03:43 PM
sanguango
 
25 posts · May 2011
Thanks, juggledad! I've been trying to use this code to exclude the date from category 3 but it didn't work:

Code:
<?php if (!in_category('3')) { ?> %date('d.m.y')% <?php }; ?>
I put the code in the loop. I also tried activating and deactivating the
Code:
%date('d.m.y')%
code in the kicker, but nothing changed. Does anyone know what am I doing wrong?

Thank you
  #6  
Old Jun 5, 2011, 04:02 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What version of Atahualpa and WP?
What is the url?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Jun 5, 2011, 04:09 PM
sanguango
 
25 posts · May 2011
Atahualpa 3.6.7
WordPress 3.1.3

Last edited by sanguango; Jun 7, 2011 at 02:33 PM.
  #8  
Old Jun 5, 2011, 04:43 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
go find all the 'BUGFIX 367-nn:...' threads in the 'New Versions & Updates' forum and apply the patches.

Which of your posts ARE in category '3' and which are not?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Jun 5, 2011, 04:51 PM
sanguango
 
25 posts · May 2011
I'll do that right now!

There are two posts in category 3: "Maestría en... " and "Especialización en...". The remaining posts are in category 4.

Last edited by sanguango; Jun 5, 2011 at 05:35 PM.
  #10  
Old Jun 5, 2011, 05:04 PM
sanguango
 
25 posts · May 2011
Done. Bugfix 367-1,2&3 are installed now.
  #11  
Old Jun 5, 2011, 06:07 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try using date without the %

Ps the string is showing on the other pages
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #12  
Old Jun 5, 2011, 06:16 PM
sanguango
 
25 posts · May 2011
Do you mean like this?:

Code:
<?php if (!in_category('3')) { ?> date('d.m.y') <?php }; ?>
If so, I tried that but is still not working. I noted the string in other pages but I don't know why that happens. Any ideas? Thanks
  #13  
Old Jun 6, 2011, 04:46 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
use
HTML Code:
<?php if (!in_category('3')) { echo date('d.m.y'); } ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #14  
Old Jun 6, 2011, 06:58 AM
sanguango
 
25 posts · May 2011
It doesn't work. With this code, today's date appears in all pages instead of the string.
  #15  
Old Jun 6, 2011, 11:03 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
well that's what you are telling it to do. If you only want it on post pages you need to expand the conditional statement to check if you are on a 'page' page or a 'post' page
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #16  
Old Jun 6, 2011, 03:10 PM
sanguango
 
25 posts · May 2011
But, besides that problem, the thing is that I'm trying to exclude the date from category 3, and the posts in category 3 still shows the date. Do you know why the code is not working?
  #17  
Old Jun 6, 2011, 05:55 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
are your posts only in category 3 or do they have multiple categories?
why don't you display the category names in the post footer
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #18  
Old Jun 6, 2011, 06:04 PM
sanguango
 
25 posts · May 2011
The first two posts are in category 3 only. Category names are displayed now in the post footer.
  #19  
Old Jun 6, 2011, 06:16 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
The dates are the date you created the post, not the date displayed by the code you put in.
What do you have at ato->Edit POST/PAGE INFO ITEMS
KICKER: Homepage
KICKER: Multi Post Pages
KICKER: Single Post Pages
and KICKER: "Page" Pages


If you click on the categpry name, and go to the category page, you see two dates, today and the date of the post
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #20  
Old Jun 6, 2011, 06:22 PM
sanguango
 
25 posts · May 2011
Exactly. What I am trying to do is to show the date I created the post in all categories but in category 3. Am I using the wrong code for that?
  #21  
Old Jun 6, 2011, 06:27 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
if you want help, and I ask a question, please answer it. go back and reread my last post
also you may want to go back and re-read post #2.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #22  
Old Jun 6, 2011, 06:36 PM
sanguango
 
25 posts · May 2011
Sorry, I didn't realize it was a question. I apologize for my English, I'm not a native speaker.

At ato->Edit POST/PAGE INFO ITEMS->Kicker I have:
Code:
%date('d.m.y')%
Thank you very much for your help!
  #23  
Old Jun 6, 2011, 07:08 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
if you read the documentation on that page you will see
Quote:
%date('F jS, Y')% - Display the date and/or time the post was published at. Many configuration options at PHP Date. Because most letters of the alphabet represent a certain PHP date/time function, you need to escape each letter that you want to display LITERALLY. To escape a letter, put a hash character # right before that letter. (Note that this is different from the original "PHP way" of escaping with backslashes \. The theme needs the hash character #). The hash will tell the theme that you mean the actual letter and not the corresponding PHP date/time function.
so when put in the kicker, the %date(...) returns the 'date and/or time the post was published' - it is just a way to format the post date

When used in index.php %date(...) returns the current because it just a PHP function and that is what the function does.

You should go back and read post #2 of this thread - edit index.php and make the code that displays the byline or kicker (what ever you want) the TRUE portion of your conditional statement.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #24  
Old Jun 7, 2011, 12:36 PM
sanguango
 
25 posts · May 2011
Like this:
Code:
<?php if (is_category('3')) { bfa_post_kicker('<div class="post-kicker">','</div>'); } ?>
? I tried this but it didn't work. Thanks again!
  #25  
Old Jun 7, 2011, 01:04 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
go read http://codex.wordpress.org/Condition..._Category_Page and then see if you can tell me what you are doing wrong.
__________________
"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
How to put picture into Byline? AJHackett Post-Kicker, -Byline & -Footer 10 Mar 7, 2011 04:07 AM
byline mick s Post-Kicker, -Byline & -Footer 3 Feb 6, 2011 08:30 PM
3.4.9 bug, % in byline Wimbledon Post-Kicker, -Byline & -Footer 6 May 23, 2010 09:21 PM
Byline: Homepage cvan Post-Kicker, -Byline & -Footer 1 Sep 6, 2009 04:25 AM
BYLINE Customization Darren Sproat Post-Kicker, -Byline & -Footer 0 Mar 21, 2009 04:38 PM


All times are GMT -6. The time now is 08:59 PM.


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