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 »

Show custom field in kicker - only IF field value exists


 
Prev Previous Post   Next Post Next
  #1  
Old Apr 13, 2010, 09:38 AM
jaxon
 
27 posts · Jan 2010
Show custom field in kicker - only IF field value exists

Hi folks,

I'm using title images images for some page titles. To make these images appear, I'm using the technique detailed in this post: http://forum.bytesforall.com/showthread.php?t=1542 It put's the following code in the kicker page info item.

<a href="%permalink%"><img id="postheadingimg-%post-id%" class="postheadingimg" src="/path/to/images/%meta('postheadingimg')%" alt="%post-title%" /></a>

The basic concept is to add a custom field for header images. Then give that field a value corresponding to each page's header image. This works great, as long as a header image exists. If the custom field is not assigned to a page, I just get a "text output" of the page title.

So, the problem is that I need the custom field to ONLY display if it has a value. aka, if I assigned a header to the page. This would be easy peazy put it in a pie if I could pass custom fields to the loop, but.... Atahualpa doesn't support that. If it did, I could do something like this:

<? if (get_post_meta($post->ID, 'postheadingimg', true)) { ?>
<img src="<? bloginfo('url'); ?>/wp-content/page_titles/<? echo get_post_meta($post->ID, 'postheadingimg', true) ?>" alt="<? bloginfo('name'); ?>" />
<? } else { ?>
<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>
<? } ?>

So.... The obvious solution seems to be using a if/else statement in the Page info items area of ATA. This is where I could use help. What would that code look like? Logically it would be...

Kicker:
If the header custom field has any value
show the value
Else
Show the current page title

Byline:
If the header has any value
show the current page title (this is for the search engines - so that there will always be H1 text but would then be move off screen with CSS)
Else
do nothing

I would then, just eliminate bfa_post_headline from the loop all together...

So, any ideas folks?
Thanks a ton for any suggestions!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Line breaks in post content field? sammie Atahualpa 3 Wordpress theme 4 Nov 12, 2010 04:04 PM
How to change the font of comment field's title? Antonino Giglio Header configuration & styling 3 Mar 8, 2010 10:18 PM
Styling the comments area title font, form field and label font, and form field sizes jkintzele Comments, trackbacks & pings 5 Nov 10, 2009 09:18 AM
[SOLVED] post - custom field isa Forum How-To 0 Sep 17, 2009 02:44 PM
Custom Field: Default Values gungo Atahualpa 3 Wordpress theme 13 Sep 12, 2009 08:36 AM


All times are GMT -6. The time now is 09:12 AM.


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