Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

[Genesis] how to put a "tweet" button under each post in list WordPress


Howdy again WP gurus (I freakin' LOVE this site)

As I mentioned in a recent question, I'm helping a friend launch her blog and she picked a child theme from Genesis to use.

She wants a "Tweet this" button (the native Twitter one that makes the URLs) under each post.

I've got that working on the individual post page like so:
[[LINK href=""]][[/LINK]]

I'm using the WP Twitter button plugin for that:

<strong>Here's the catch (question):</strong>

She also wants it to show on on the home page (and category pages) that shows the most recent X number of blog posts. She wants it to show underneath each individual post, floated to the right, just like on the individual post page.

So if you [[LINK href=""]]look at the homepage now [[/LINK]]and scroll to the end of the post shown there, you'll see a Facebook like and a Facebook Share button. To the right of that is where she'd like the Tweet button to go. Same for the [[LINK href=""]]books category[[/LINK]].

Any idea of how to do this with Genesis (I usually just edit the templates, but that doesn't seem possible in Genesis)?

Is there a different plugin that I could use that would make it show up on the homepage and categories as well?

Answers (5)


Ivaylo Draganov answers:


I'm not familiar with Genesis but it is possible to override templates by using [[LINK href=""]]Child Themes[[/LINK]]. You have to create a child theme which uses Genesis as parent. To do that you just create a new theme as usual but add this line to <em>style.css</em>:
template: genesis

Maybe Genesis provides some way to override parts of templates. Via action and filter hooks probably. You have to check in with Genesis' documentation.

As for the Twitter button you can use the code provided by Twitter:
[[LINK href=""]][[/LINK]]

You just have to specify a <em>data-url</em> and <em>data-text</em> attributes for the <a> element because by default the Tweet button will use the current page URL and title. You should use WP's template tag <em>get_permalink</em> to get the post's URL and <em>the_title</em> for the post's title. Something like that:

<a href="" class="twitter-share-button" data-url="<?php echo get_permalink(); ?>" data-text="<?php the_title(); ?> data-count="vertical">Tweet</a><script type="text/javascript" src=""></script>

That code has to be placed inside a WP loop. If you want to have that for a long list of posts, you should use just one <em><script></em> element. Best placed at the end of the page (before <<em>/body></em>).


Vidyut Kale answers:

Hook the code to "genesis_after_post"

Something like

add_action('genesis_after_post' , 'sweety_tweety');
function sweety_tweety() {
echo "Insert button code of choice";

Style as needed in your regular style.css file.


Rashid Aliyev answers:

Find part of code where the post printing. And add line of twitter after it. If possible write address of your site to look to code (HTML) and after i can write correct place and correct code. But simplest, you can use chevreshare or analog sharing plugin.


Rashad Aliyev answers:


I suggest you my own sharing plugin. ( [[LINK href=""]][[/LINK]] )

After setup this plugin then you can use it on the left or right sidebar or you can put the code on your theme (single.php or page.php )

For example using special codes for your site. You can also using "big" or "small" size for facebook, twitter, digg, buzz etc.

<?php cevhershare_button('name','size'); ?>

You can get more information: [[LINK href=""]][[/LINK]]


Gabriel Reguly answers:


WordPress has it's own plugin for this task.

It is very flexible and easy to use.

Please find it at