Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   PHP goodies for kicker/footer? (http://forum.bytesforall.com/showthread.php?t=3840)

paulae Oct 12, 2009 11:36 AM

PHP goodies for kicker/footer?
 
I just noticed that, at least in ATA 3.4.4, you can add PHP in the Edit Post/Pages area. Yes! I've never done that, and I'm trying to figure out a cool way to use this. Any ideas, anybody?

For instance, I think you could use PHP to make a certain plugin run at the bottom of just a certain page, or category. I'm sure there are great uses for this. Care to brainstorm? How would you use this wonderful idea?

juggledad Oct 13, 2009 07:01 AM

Here is one idea, I didn't like the 'Add to Any' plugin icons at the top of my posts, I wanted them part of the post's footer

1) I took the 'Add to Any' plugin code:
HTML Code:

<?php echo '<ul class="addtoany_list">'; if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) ADDTOANY_SHARE_SAVE_ICONS( array("html_wrap_open" => "<li>", "html_wrap_close" => "</li>") ); if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) ADDTOANY_SHARE_SAVE_BUTTON( array("html_wrap_open" => "<li>", "html_wrap_close" => "</li>") ); echo '</ul>'; ?>
2) I added a '<br> at the beginning.
3) I added it to the end of the FOOTER of the Posts (ATO->Edit POST/PAGE INFO ITEMS->FOOTER: Homepage - also did it for the 'FOOTER: Multi Post Pages' and 'FOOTER: Single Post Pages') so the FOOTERS look like this
HTML Code:

%date('F jS, Y')% | %tags-linked('Tags: ', ', ', ' | ')% Category: %categories-linked(', ')% | %comments('Leave a comment', 'One comment', '% comments', 'Comments are closed')% %edit(' | ', 'Edit this post', '')%
<br><?php echo '<ul class="addtoany_list">'; if( function_exists('ADDTOANY_SHARE_SAVE_ICONS') ) ADDTOANY_SHARE_SAVE_ICONS( array("html_wrap_open" => "<li>", "html_wrap_close" => "</li>") ); if( function_exists('ADDTOANY_SHARE_SAVE_BUTTON') ) ADDTOANY_SHARE_SAVE_BUTTON( array("html_wrap_open" => "<li>", "html_wrap_close" => "</li>") ); echo '</ul>'; ?>

and now I have the icons as part of the post footer.

You can see how it looks at Call of the Muse

paulae Oct 13, 2009 09:37 AM

Looks good. I've done that too, just using the Share/save plugin's config info. You get to say where you want it to show up, so that's easy!

I guess you could use it to display an image, right?

juggledad Oct 13, 2009 01:31 PM

sure, since you can put in any PHP in you could do a simple <image..> or if you only wanted it on the frontpage
'<?php if (is_front_page() { echo '<image...>';} ?>

BradBrown Oct 13, 2009 04:21 PM

One of my ATA sites has a multi-author blog. I use the following snippet of code in the kicker to display the author's avatar:

PHP Code:

<?php echo get_avatarget_the_author_email(), $size '48'$default '' ); ?>

I have the CSS set up so the avatar displays to the left of the headline and byline, instead of above.

joan Oct 14, 2009 08:13 AM

I have used this in the byline with :

<?php if ( in_category('490') ) { echo '<div id="divBod"><img src = "http://travelhorizonstyle.com.au/wp-content/uploads/5percent.png" /></div>';} ?>

With 'CSS Inserts' :
#divBod {float: right; width: 20%; z-index:1;}

However it in IE8 (not FireFox & Chrome) it truncates the excerpts box on the right side. This is really a css styling issue, but just in case anyone has any suggestions.


All times are GMT -6. The time now is 04:24 AM.

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