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!