Tag Info

Hot answers tagged

11

I wrote a shortcode function based on "Twitter Hash Tag Widget" plugin just copy this function to your themes functions.php file function tweets_by_hashtag_9867($atts, $content = null){ extract(shortcode_atts(array( "hashtag" => 'default_tag', "number" => 5, ), $atts)); $api_url = ...


11

This is a little tricky because sanitize_user allows spaces in usernames, meaning it difficult to avoid grabbing the whole phrase '@johndoe said that ... ' as opposed to just the actual username '@johndoe' and you have no separator at the end that would help. To avoid that I imposed a requirement that spaces in the username be replaced with '+'. function ...


7

You need to do this in steps: Decide when you are going to parse the user's meta to change the value. Define a function to do that. Hook that function to the appropriate action. The original answer defined what you need to do for step #2, using preg_match() to parse the Twitter URL and extract the username. function update_the_user( $user ) { // ...


6

Otto has some great plugins for facebook and twitter. The one is Simple Facebook Connect (Wordpress Plugin) the other is Simple Twitter Connect (Wordpress Plugin). I think you're looking for this functionality: Automatically Publish new posts to Facebook Profile or Fan Page and for Twitter: Auto-tweet new posts to an account. Both are offered by the ...


4

This is a bit of a multi-part question, so you're getting a multi-part answer. Getting the Facebook count can be done by making a request to https://graph.facebook.com/URL. This will return a json object which contains, among other things, the number of "shares". Working example which has 4 shares as of this writing: ...


4

I've managed to find a solution to my problem. I solved it with three plugins Members User Role Editor Social Login The combination of these plugins allows you to who can log in, without telling them how to log in. More specifically, anyone will be able to log in with a social network, but they won't be able to see everything. With User Role Editor, you ...


4

As the author of Twitter Tools, I can confirm it is alive and well. Twitter Tools 3.0 beta 2 was released earlier this year: http://alexking.org/blog/2012/01/22/twitter-tools-3-0-beta-2 Now that Social 2.5 is out, a final release of Twitter Tools 3.0 will be available once we have some time to finish testing. You can always grab the latest version from ...


3

STC does not have a signup/register function, because Twitter doesn't provide any API to get an email for the user. So the signup process has no way to email the user with valid information like password and such. If you have a better way/workflow/design/idea to do it, then I'd be happy to add it to Simple Twitter Connect.


3

Hi @Nam Gi VU: In general, this is not really a WordPress question. I'll answer it because I tend to be lenient about how related questions need to be but there's a good change another moderator will close the question and if they do I'll agree. Basically since WordPress.com does not provide this feature you need to use a 3rd party service that will read ...


3

Both Simple Facebook Connect and Simple Twitter Connect have features to allow users to post comments using their Facebook or Twitter credentials. Among other things. Disclaimer: I wrote 'em both.


2

There are 2 ways to do this. The first is to create a function that outputs the buttons and then include it in your template. The second is to add a filter to either the_content or the_excerpt or both depending on where you want the buttons to show up. In either case the first thing you need to do is separate out the script calls from the code that ...


2

Looks like you've mis-named the function. It is the_tweetbutton(), rather than tweetbutton(). Also, you should always wrap Plugin-added function calls in if (function_exists()) conditional wrappers. Putting that together, this: <div id="tweet-button"> <?php tweetbutton(); ?> </div> Becomes this: <div id="tweet-button"> ...


2

Two issues: The code you're using requires Administrator-role capabilities The code you're using requires fopen() wrappers, which may be disabled by your host You should probably be using wp_remote_get() instead of file_get_contents(). I would also recommend caching the result, rather than storing it as a DB option. But, let's start with the basics. I'm ...


2

Ouch, that snippet is ancient (I am kinda its author, more precisely adapted to twitter from other snippet). I would strongly consider using some newer solution. I had later made newer and written from scratch version, try it http://www.rarst.net/script/twitter-counts-wordpress/


2

WordPress doesn't have "tweeting" functionality built in. However, post scheduling is built in. You just set the time when you want the post to publish on the edit post screen. If you use a twitter plugin like my own Simple Twitter Connect, and you schedule a post, then it will send the tweet at the same time as the post is published. STC requires some ...


2

Depending on the particular Twitter plugin you're using, you could filter based on the presence of a particular hash tag. Twitter Tracker appears to have the ability to do this when the search is of the form #hashtag from:username.


2

There's Tweet Blender, seems pretty flexible and full of options: Provides several Twitter widgets: show your own tweets, show tweets relevant to post's tags, show tweets for Twitter lists, show tweets for hashtags Twitter Hash Tag Widget: A widget for displaying the most recent twitter status updates for a particular hash tag. Twitter ...


2

Hi Rob@:try with this plugin Tweet This.you can set your custom image also.:) or Try this code... Open the sidebar.php Locate the “twitter-feed” div <div class=”twitter-feed”> <h2>What I’m up to…</h2> <ul id=”twitter_update_list”></ul> <script type=”text/javascript” ...


2

That is one nasty regexp. I would suggest looking into Twitter entities instead, much easier than trying to parse it yourself. And this really has little to do with WP and more suitable for other sites in network.


2

I use the following code to intrude myself into WPTouch until I buy a licence :) Better than simply hiding other plugins is disabling everything you can of it. And the visitor gain less (and unnecessary) elements to load in their device. The insert_scripts is pretty straight forward, adjust to your needs. The remove_scripts I did from a fast analysis of ...


2

The problem is that get_the_title() will pass the title through a filter that texturizes the quotes. So a regular " becomes a curly quote (“) and urlencode() will break it. So instead, write your own title function and use that: function my_get_the_title() { global $post; return $post->post_title; } This should bypass any unwanted ...


2

Disqus is a popular cross-site comment system which allows logging in via various methods, including Twitter, Facebook and your own disqus account. They obviously have their own Wordpress plugin you should check out.


2

This is because of a variable mismatch. Your function accepts $post_ID, but you don't actually use it. You're instead trying to reference a global $post object and doing your post format check with $post->ID. With the XML-RPC request, this won't work. Rewrite your function to use get_post() to fetch a post object from the passed-in ID: function ...


2

In the insert_posts function, before the line $post_id = wp_insert_post( $post ); add the following (and suit to your needs): Link to Twitter User Page $post['post_content'] .= '<a href="http://twitter.com/__USERNAME__">' .'Follow me on Twitter' .'</a>'; and/or Link to Twitter Status $post['post_content'] .= '<a ...


2

The mark-up surrounding the widget is malformed. IE isn't handling this as well as other browsers. <h1>Twitter</h1><h2><a href="http://twitter.com">Follow</h2> <div><h2><span class='twitterwidget twitterwidget-title'> Note the opening anchor tag before "Follow". This is never closed.


2

There is an extra action hook for scheduled posts: publish_future_post - it isn't very good documented though. There are occurrences of the hook in: /wp-includes/default-filters.php /wp-admin/includes/upgrade.php /wp-includes/post.php The hook invokes check_and_publish_future_post(). Read the linked information, if you want to inform yourself further. ...


2

I've used add_action ('transition_post_status', 'my_action'); and it works great for both posts that are published directly or in the future. The function my_action being: function my_action ($new_status, $old_status, $post) { if (($old_status != 'publish') && ($new_status == 'publish')) { // doing things. } }


2

WordPress has a core function human_time_diff that does what you want, using it with the filter you provide you have someting like so: add_filter('latest_tweets_render_date', function( $created_at ){ $date = DateTime::createFromFormat('D M d H:i:s O Y', $created_at ); return sprintf( '%s ' . __( 'ago' ), human_time_diff( $date->format('U') ) ); ...


1

That tutorial is no longer valid as Twitter's API have changed June 2013. There are are some great tutorials that came out just after June 2013 for Twitter API v1.1. Why not use a plugin. It is actually better to go that root as these plugin developers keep their plugins up to date and are quick to modify them if someone like twitter change their API


1

It is very likely because you are using the old Twitter API, for example: <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/USERNAME.json?callback=twitterCallback2&amp;count=4"> You will need to update your code to the new API: ...



Only top voted, non community-wiki answers of a minimum length are eligible