Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   Need help with Author Bio Coding (http://forum.bytesforall.com/showthread.php?t=20031)

munchy_cool Mar 29, 2013 07:26 PM

Need help with Author Bio Coding
 
So I want to add author bio to end of each post, modifying single.php

below is the code snippet

<div class="post-bodycopy cf">
<?php the_content(); ?>
<!-- patch for author bio munchy_cool -->

<!-- <?php echo get_avatar( get_the_author_meta('email') , '80' , ' ' ); ?> -->
Written by <?php the_author_link(); ?>
<p><?php the_author_meta('description'); ?></p>
<p><a href="http://facebook.com/<?php the_author_meta('facebook_profile'); ?>" target="_blank"><img src="mysite.com/image.png" width="16" height="16" alt="Facebook" /></a>
<a href="http://twitter.com/<?php the_author_meta('twitter_profile'); ?>" target="_blank"><img src="mysite.com/image2.png" width="16" height="16" alt="Twitter" /></a><br /></p>
<!-- end of patch -->

Problem 1
<!-- <?php echo get_avatar( get_the_author_meta('email') , '80' , ' ' ); ?> -->

is not working , display a '80 on the page

Problem 2
the facebook and twitter images do not appear is 16,16 even though that's what I set them to above, any help would be appreciated.

Thanks

juggledad Mar 29, 2013 07:37 PM

1) get_avatar is not in the limited php code allowed in the virtual templates
2) if you are on version 1.1.3, do you have patch 113-06 applied?

munchy_cool Mar 29, 2013 08:30 PM

yes sir, the patch is applied ..

anything on the second problem?

juggledad Mar 30, 2013 03:29 AM

What is the URL?

munchy_cool Mar 30, 2013 07:25 AM

the website is a news website so I have not yet pushed the changes online, I am testing on my local wordpress installation, I can attach a screenshot if needed of my local test page

juggledad Mar 30, 2013 10:07 AM

what plugin are you using to put the fac ebook and twitter info in the author meta?

munchy_cool Mar 30, 2013 10:36 AM

I am not using any plugin, i added below code to functions.php

/*================================================= ==================================
* Add Author Links
* ================================================== ===============================*/
function add_to_author_profile( $contactmethods ) {
$contactmethods['rss_url'] = 'RSS URL';
$contactmethods['google_profile'] = 'Google Profile URL';
$contactmethods['twitter_profile'] = 'Twitter Profile URL';
$contactmethods['facebook_profile'] = 'Facebook Profile URL';
$contactmethods['linkedin_profile'] = 'Linkedin Profile URL';
return $contactmethods;
}
add_filter( 'user_contactmethods', 'add_to_author_profile', 10, 1);

function hide_profile_fields( $contactmethods ) {
unset($contactmethods['aim']);
unset($contactmethods['jabber']);
unset($contactmethods['yim']);
return $contactmethods;
}
add_filter('user_contactmethods','hide_profile_fie lds',10,1);

also I have made some progress with the images, instead of using 32x32 images I am using 16x16 images for the facebook and twitter links but now the problem is that the author bio is in a box and the facebook and twitter images are also inside a box but they kinda go out of the original box, author gravatar is still not working though.

here is the code in single.php
<div class="post-bodycopy cf">
<?php the_content(); ?>
<!-- patch for author bio -->
<div class="postauthor">
<!-- <?php echo get_avatar( get_the_author_meta('email') , '80' , ' ' ); ?> -->
<p class="hlight"> Written by <?php the_author_link(); ?> </p>
<p><?php the_author_meta('description'); ?></p>
<a href="http://facebook.com/<?php the_author_meta('facebook_profile'); ?>" target="_blank"><img src="facebook-pencil.png" alt="Facebook" class = "rsslink" /></a>
<a href="http://twitter.com/<?php the_author_meta('twitter_profile'); ?>" target="_blank"><img src="\twitter-pencil.png" alt="Twitter" /></a><br />
</div>

<!-- end of patch -->
<?php wp_link_pages( array(
'before' => __( '<p class="post-pagination">Pages:', 'montezuma' ),
'after' => '</p>'
) ); ?>

here is the css i added in posts.css
.postauthor {border-left: 1px solid silver;border-top: 1px solid silver;border-right: 1px solid silver; border-bottom: 1px solid silver; margin-top: 5px; margin-bottom: 10px; padding-left: 15px; padding-bottom: 5px; padding-right: 15px; padding-top: 5px; background-color: transparent; background: url(images/body-bg17.png); width: 525px; margin-top:5px;}
.postauthor img {float: left;}
.postauthor h4 {color: #666; font-size: 1.5em; margin-bottom: 5px;}
.postauthor p {color: #515151; font-size: 13px; margin-bottom: 7px; border:none, outline: none;}
.postauthor p.hlight {font-size: 11px; text-transform: uppercase;}

here is how it looks - http://imgur.com/sIlXARF

Notice the facebook and twitter icons have a border which is not inside the box, I tried removing the border by adding below line to css above
.postauthor a {border:none;}

but no go.
Also any help with gravatar would be awesome and we may have a working author bio for the theme.

juggledad Mar 30, 2013 01:50 PM

as I said, the get_avatar() is NOT part of the Limiteed PHP coe allowed in the virtual templete.

munchy_cool Mar 30, 2013 01:52 PM

anywhere else we can put that, and any help on the icons going out of the box?

juggledad Mar 30, 2013 05:11 PM

Quote:

anywhere else we can put that
There was a post about adding new functions to the 'Limited PHP Code' that you could follow. I do not have the link to it so you will have to search the forum for it.
Quote:

any help on the icons going out of the box?
I would use the FireBug Extension of FireFos and play wiith the positioning of the icons.


All times are GMT -6. The time now is 03:28 PM.

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