PDA

View Full Version : Display Twitter on Author page


darrylo
05-08-2009, 04:53 PM
Love this plug-in - exactly what I was looking for! I want to add the code on the author page and <?php display_twitter(); ?> doesn't work. Here is the author page (the posts show the twitter link but I want it with the author information: http://afadarien.com/?author=5 Thanks for your help

Kevin
05-08-2009, 05:08 PM
Hi Darrylo,

Glad you love the plugin.

I just added the plugin to our author pages using <?php display_twitter(); ?> and it worked fine (see here (http://www.bloggingtips.com/author/admin/) for example).

I checked one of the posts of the author page you posted and their twitter is, as you say, definately showing there (it won't show for users who haven't updated their profile with their twiter info).

Can you post your author.php template here. It might give us an idea what's wrong :)

darrylo
05-08-2009, 05:47 PM
I think the difference is I want it to show on the "current author" ? Anyway here is my author.php
--------------------
<?php get_header(); ?>

<div id="content">

<div id="contentleft">

<div class="postarea">
<?php $recent = new WP_Query("showposts=1"); while($recent->have_posts()) : $recent->the_post();?>



<?php $curauth = (get_query_var('author_name')) ? get_userdatabylogin(get_query_var('author_name')) : get_userdata(intval(get_query_var('author'))); ?>

<div class="author">

<?php userphoto($wp_query->get_queried_object()) ?>
<p><?php if(file_exists(TEMPLATEPATH.'/images/agents/'.$curauth->ID.'.jpg')) : ?>
<img style="float:left;margin:0px 10px 10px 0px;" src="<?php bloginfo('template_url'); ?>/images/agents/<?php echo $curauth->ID; ?>.jpg" alt="<?php echo $curauth->display_name; ?>" title="<?php echo $curauth->display_name; ?>" />
<?php endif; ?>
<b> <?php echo $curauth->display_name; ?> </b>
<br />
<a href="mailto:<?php echo $curauth->user_email; ?>"><?php echo $curauth->user_email; ?></a>

<?php echo $curauth->description; ?></p>
</div>

<div style="clear:both;"></div>

<?php endwhile; ?>

<h5>My Posts</h5>
<?php display_twitter(); ?>


<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
<?php else: ?>
<?php endif; ?>

<?php the_content_limit(400, "[Read more]"); ?><div style="clear:both;"></div>

<div style="border-bottom:1px dotted #BBBBBB; margin-bottom:10px; padding:0px 0px 0px 0px; clear:both;"></div>

<?php endwhile; ?>

<?php endif; ?>
<p><?php posts_nav_link(' — ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?></p>

</div>

</div>

<?php include(TEMPLATEPATH."/sidebar.php");?>

</div>

<!-- The main column ends -->

<?php get_footer(); ?>

sarahG
05-08-2009, 11:45 PM
The function isn't working because it is designed to work on a single post page, after the post has been shown (either right after the post or elsewhere on the page, but after the loop has executed). Your code above shows the function before the loop is executed, so it doesn't know what author is to be displayed.

It can be modified to work with the author ID, that way you could pass the $curauth->ID to the function. I'll see if I can update it this weekend to do that for you.

Brennan
11-08-2009, 07:19 PM
Do it the same way you're doing. It's stored in the db so you can access it the same.

If you want to link to the authors twitter page do this:
<a href="http://www.twitter.com/<?php echo $curauth->twitter;?>">Twitter</a>

jiya49
02-25-2010, 03:30 AM
thanks for the trick, its working fine.

patidarnilesh
02-25-2010, 03:39 PM
Hi !!!!
Thanks a lot for giving wordpress information.
--------------
We invite you to join the leading company from India.
Here we are available for all your needs of outsourcing and Home Based Job.
The one and only NPD Group
---------------
NPD Group (http://www.npd-group.co.cc)
Work From Home (http://www.workfromhomejobs7.webnode.com)

Dirky47
03-24-2010, 08:23 AM
thanks for the sharing I will try this too. I hope it will works in me.

zsameer
04-14-2010, 05:53 PM
thanks for great information.

Dirky47
05-11-2010, 08:59 AM
It's working on me. How about in you guys?

kiran07
05-15-2010, 03:15 PM
Business / Investing



http://6bf63cpmqceq3uabqp-h32ojra.hop.clickbank.net/
http://cf0b3csnmbkw1p4ku0k7jftqay.hop.clickbank.net/
http://d9bfchklbdcr2seif-m0gzjw9-.hop.clickbank.net/
http://df5a9eolplgtaodivg8ac9sg8-.hop.clickbank.net/
http://6ddf9cnod8jsap8l25q8mfua9t.hop.clickbank.net/
http://6bcc7fxhka9v2n1bt4j6tc8v06.hop.clickbank.net/
http://b23247pjq8kvfm03ih3dlhbz4d.hop.clickbank.net/
http://1f0405vklibpdraqk5x05rgveq.hop.clickbank.net/

Dirky47
06-28-2010, 08:21 AM
Business / Investing



http://6bf63cpmqceq3uabqp-h32ojra.hop.clickbank.net/
http://cf0b3csnmbkw1p4ku0k7jftqay.hop.clickbank.net/
http://d9bfchklbdcr2seif-m0gzjw9-.hop.clickbank.net/
http://df5a9eolplgtaodivg8ac9sg8-.hop.clickbank.net/
http://6ddf9cnod8jsap8l25q8mfua9t.hop.clickbank.net/
http://6bcc7fxhka9v2n1bt4j6tc8v06.hop.clickbank.net/
http://b23247pjq8kvfm03ih3dlhbz4d.hop.clickbank.net/
http://1f0405vklibpdraqk5x05rgveq.hop.clickbank.net/gry.


Your making me angry :mad:

kosovohp
10-17-2010, 07:08 AM
Love this plug-in - exactly what I was looking for! I want to add the code on the author page and <?php display_twitter(); ?> doesn't work. Here is the author page (the posts show the twitter link but I want it with the author information: http://afadarien.com/?author=5 Thanks for your help
_______________________
wholesale soaps (http://www.soapitup.com.au)
LED Lamp (http://www.led-light-24.com)

shenhua00
11-03-2010, 10:46 AM
You could ask one of the
Buy Aion Gold (http://www.gobuyaiongold.com/): Varya or Cunningham-they are the big

hitters. I am soaking wet on a buck. I could not keep up with them with a subscription to Elias

Sports Bureau, and a £ 5 thesaurus.Check from Matt Goldberg. He is for a few
Buy WOW Gold (http://www.zyy.com/) later he wrote faster than Michael Phelps collected

Medals and earned a slot in the prestigious series of featured columnists like Vincent Heck, Asher

Chancey
WOW Power Leveling (http://www.wowpowerlevelingup.com/)... not to mention Gary Suess. How

can I jealous of a man named after the greatest poets of all time? I feel like I should give him a

hug. Not on a carpet or near a bug-hug just like him I think are a mug. There even some girls run up

the ranks. As Aion level. She dishing Phillies' food for over a year and draws hundreds of reads

with every post
WOW Gold (http://www.storeingame.com/).:eek:

thpalex
11-24-2010, 10:56 AM
Thanks for your information, I was looking for this kind of stuff.

PaulSmith
11-25-2010, 02:57 PM
Thanks for this coding help, it was helpful to me also.

webtwilight
11-25-2010, 07:13 PM
If you use wordpress, I found a great plugin for your site. It's called TweetPress.
TweetPress is the Wordpress Plug-In that gives you total control and ownership of the photos you post to Twitter, sending traffic back to your own blog, instead of a third party site.

TweetPress (http://brandontreb.com/tweetpress/)