Affichage des articles dont le libellé est Bringing. Afficher tous les articles
Affichage des articles dont le libellé est Bringing. Afficher tous les articles

samedi 12 novembre 2016

Bringing Tweets Into Your WordPress Site



alt="Bringing Tweets Into Your WordPress Site" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/06/8-500x233_c.jpg" />

For reasons that elude most bloggers and content creators, a decidedly large rift has opened between those who maintain standard weblogs and those who frequently contribute to Twitter via a shorter, “microblog” format of writing. This rift has caused virtually every major content management software solution to leave out support for importing tweets into entries, website designs, and back-end control panel interfaces.

WordPress, with 60 million users, is the largest content management platform to exclude Twitter from the conversation in a native way. Luckily, the large and growing community of content creators served by WordPress is also served by an appropriately large and active development community which has made href="http://www.webhostingsecretrevealed.net/blog/wordpress-blog/30-free-social-media-plugins-for-your-wordpress-blog/">Twitter and a few other major social media integration a priority.

The only downside of this strictly-plugin-based approach to WordPress content aggregation is that the typical user will require several different plugins, and several different approaches, when making sure that their website is satisfactorily integrated with the Twitter service both in the website’s design and within the actual WordPress Dashboard administration interface itself. It can be a tangled web of different WordPress plugins and approaches but, when all is said and done, it’s still better than being completely cut off from one of the world’s most popular and important social networks.

Here’s how to make WordPress and Twitter talk to each other, even if their respective developers have hesitated to do so.

Bringing Tweets to the WordPress Sidebar

The most popular feature request for WordPress, at least as far as Twitter integration is concerned, is the ability to bring standard Twitter tweets into the default WordPress sidebar either using a PHP variable, inclusion code, or a WordPress widget. While the company offers a Twitter widget to users of its remotely-hosted WordPress.com blogging service, it offers no such widget to those customer who simply download the software and install it on their own web server. This is a disappointing setback, but not one which is insurmountable.

First and foremost, a plugin known as “href="http://wordpress.org/extend/plugins/twitter-widget-pro/" target="_blank">Twitter Widget” on the WordPress Plugins website enables this Twitter widget for all users. However, this is not the same as the standard, WordPress-developed Twitter widget for remotely-hoted weblogs. Instead, this widget is developed by a third-party individual and it looks appropriately “third party.” Instead of using the WordPress API to produce a user-customizable output of Tweets, it merely places the standard Twitter “badge” within a WordPress widget that can be dragged and dropped throughout the sidebar. It’s better than nothing, but it’s not great. It’s perfect for novice users, but those with more advanced skills will appreciate the alternative solution to Twitter integration that follows.

For advanced WordPress designers, a plugin known as href="http://wordpress.org/extend/plugins/wp-twitter-feed/" target="_blank">WP Twitter Feed is much more adept at producing custom Twitter outputs across templates, in any area where a short code or PHP variable can be inserted into a WordPress template. This is perhaps less immediately convenient than a WordPress widget that can be dragged and dropped within a sidebar, but it’s far more extensible, scalable, and customizable.

Using WP Twitter Feed

style="text-align: center;">class="border aligncenter" alt="Twitter Feed" src="http://www.webhostingsecretrevealed.com/images/2013/0319-1.jpg" width="750" />

A little known fact about WordPress theme development is that the use of brackets can actually serve as a variable to insert content into a template if a plugin has enabled this feature. The WP Twitter Feed widget takes advantage of this fact, and a Twitter feed can be placed anywhere into a WordPress template using the following code:

[twitter-feed username=”your-username-here”]

 

Simply enough, this displays the five most recent tweets by the user whose username lies between the relevant quotation marks. But, because this plugin is designed for more advanced WordPress developers, it can actually be used to display some other content that is popular among Twitter users and WordPress content creators alike. All it requires is a simple modification to the short code insertion tag.

[twitter-feed username=”your-username-here” mode=”mentions”]

This tag will cause WordPress to print every “mention” of a user’s Twitter handle. A mention is typically constructed as @your-username-here and it’s the way Twitter users converse among themselves. Printing mentions of a username, rather than merely printing the latest Tweets that user has written, is a great way to convey importance, authority, and content knowledge to new readers who want to know why an author is qualified to speak on the subject which they are currently writing about.

[twitter-feed mode=”hashtag” hashtag=”Boulders”]

Hashtags are the number one way to get an idea of what’s trending on Twitter at any given moment. Luckily, any hashtag can be shared with site readers by modifying the short code insertion which is placed into WordPress templates. In the example above, every tweet with the hashtag #Boulders will be displayed (up to the five most recent) to site visitors.

< ?php echo do_shortcode(‘[twitter-feed]’); ? >

Of course, no plugin would be complete without a standard PHP variable or template tag method of insertion, and WP Twitter Feed is no exception to this important rule. Those users who want to use the standard PHP method of including plugin content are free to do so, and they can modify the content between the brackets (currently [twitter-feed] in this example) just like they would modify the short codes above when customizing content. This PHP variable exists largely so that the plugin can be implemented in any area of any template that WordPress manages, instead of just being used in the sidebar and on index pages. Feel free to use it wherever a tweet should be included, however, as its universal appeal will work in any template, anywhere — even alongside traditional short code uses.

Beyond the examples listed here, there are literally tens of variables which can be used to customize the output and content produced by the WP Twitter Feed widget. It is, without a doubt, the closest thing to a real WordPress Twitter widget or content aggregation service. It’s as customizable as anything included natively with the WordPress content management software, while being simple (no control panel) and extensible (using variables) enough for both novice and advanced users.

Sending WordPress Content to the Twitter Feed

Just as important as bringing Twitter content into the WordPress design is sending notifications about new content to the millions of Twitter users who monitor the site for trending topics, new commentary, and blog entries. This cannot be done natively with the WordPress control panel, unfortunately, and so it must be done by installing a plugin that allows for a direct link between the WordPress Dashboard and the Twitter OAuth authentication protocol. The best way to do this is to enlist the help of the “href="http://wordpress.org/extend/plugins/wp-twitter-feed/" target="_blank">WP To Twitter” plugin for self-hosted installations.

The plugin resides in the standard plugin directory and produces a very simple customized control panel that determines how each post is shared with the world’s most popular microblogging service. Users can opt to include hashtags with every announcement of a new entry, and they can use a URL shortening service to cut down on the size of their large permalink structure. These shortened URLs do not use a website’s native domain, but instead use services like Bit.ly and Is.gd to link WordPress followers to site content.

Using WP To Twitter

The WP To Twitter plugin service also hooks right into Google Analytics, which allows website operators to see how many Twitter users actually noticed their post-related tweet and clicked through to read the website’s content. Once they’ve landed on the website, users can enjoy raw Analytics data per usual, with information about click rates, page occupation times, and other information that the service is famous for providing.

style="text-align: center;">class="border aligncenter" alt="WP To Twitter Feed" src="http://www.webhostingsecretrevealed.com/images/2013/0319-2.jpg" width="750" />

Because it allows for hashtag insertion and automated URL shortening, WP To Twitter is one of the leading WordPress Dashboard plugins for sharing full-length content directly to Twitter in 140 characters or less. The plugins is extremely lightweight, easy to install, and its custom control panel interface means that it’s as easy and intuitive to configure as any other WordPress setting or feature.

style="text-align: center;">class="border aligncenter" alt="Twitter Feed" src="http://www.webhostingsecretrevealed.com/images/2013/0319-3.jpg" width="750" height="616" />

The Full Approach: Integrating Templates, the Dashboard, and the Twitter API with One Plugin

Relying on so many independent plugins to integrate Twitter functions with the WordPress Dashboard and theme templates isn’t necessarily a bad idea, but mixing so many plugins that query the same website can be a bit problematic. Remember that all of these plugins are interacting with the Twitter website and OAuth protocol, all downloading and submitting the same information, and doing it all within the same database. The potential for bugs, glitches, and lost data is exponentially higher when combining multiple plugins for the same website in this way. In order to cut down on these potential problems, users are encouraged to streamline the process as much as possible by pursuing a policy of Twitter plugin convergence.

This might sound complex, confusing, or even impossible, given WordPress’ tenuous relationship with tweets, but it can actually be accomplished quite easily.

It’s done using the “href="http://wordpress.org/extend/plugins/twitter-tools/" target="_blank">Twitter Tools” plugin that has long been the single most popular Twitter plugin among WordPress users around the world. It has achieved that distinction by enhancing both the Dashboard and template functionality of the WordPress software, pairing it with a custom control panel, and issuing frequent updates with new features, less bugs, and improved usability.

Twitter Tools first and foremost integrates deeply into the WordPress Dashboard. It installs a customized control panel that allows users to fine tune each of its features and settings; it pairs this control panel with a Dashboard content box which sits right alongside those drag-and-drop boxes which display entry statistics, recent comments, WordPress news, and recent user activity within the Dashboard. This allows for easy, unified access to both the broader Twitter news feed as well as a user-specific news feed as defined in the Twitter Tools administration area.

Beyond that, Twitter Tools allows for generating tweets that link to each new post published within a typical WordPress installation, and it can even enable the use of short URLs that actually employ the user’s domain name rather than third-party sites like Bit.ly. Hashtags can be inserted within the Twitter Tools control panel and other default text can be added in this manner as well.

Templates are not left out of this robust plugin’s scope, as users will find it relatively easy to use a PHP variable throughout templates in order to insert tweets in any sidebar, body of content, or independent WordPress page they desire. Twitter Tools allows the appearance of this code to be customized using the plugins’ control panel interface as well; users will find it easy to determine which Twitter user’s tweets are pulled into the site’s templates and how many tweets are displayed. They can also customize the template that determines how each tweet in this list appears, and they cant determine whether hashtags, mentions, or href="http://www.webhostingsecretrevealed.net/blog/socialmedia-marketing/49-data-proven-tips-on-how-to-get-more-retweets/">retweets are displayed in this listing of recent posts.

Twitter Tools developer Alex King has even gone outside the box with his tweet-centric plugin and has included the ability to post entire digests of recent tweets for consumption by the site’s frequent visitors. This can be configured in the WordPress Dashboard within the Twitter Tools control panel, and it allows for daily, weekly, or monthly compilation of all tweets into a standard WordPress entry. It can be specially styled, and filed into a special category, all on an automatic and regular basis as the user determines.

Lack of Twitter Integration into WordPress is Easy to Overcome

Sadly, WordPress shows no signs of budging on its stance that any social networking activity will have to be added through the use of plugins. The company happily integrates with major social networks, including Twitter, on its WordPress.com remotely-hosted blogging site, but simply refuses to bring that functionality to its more advanced, customizable self-hosted variant.

Even without href="https://support.twitter.com/entries/166337-the-twitter-glossary#" target="_blank">native support for Twitter, the large number of available plugins and widgets available to users makes it easy to bring WordPress into the 21st century, even if it does so while kicking and screaming. With recent tweets in WordPress templates, news feed integration into the WordPress Dashboard, and automatically-generated tweets which announce new posts, the plugins mentioned above are a comprehensive approach to combining traditional content management with next-generation microblogging communication methods.


Page 21 – Web Hosting Secret Revealed




WordPress How To: Bringing the Gravatar into WordPress



alt="WordPress How To: Bringing the Gravatar into WordPress" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/06/wordpress-500x133_c.jpg" />

class="border" src="http://www.webhostingsecretrevealed.net/images/2012/0621-1.jpg" alt="Gravatar Homepage" width="750" />

One great way to interact with blog readers and commenters on a more personal level is to implement the use of href="http://en.gravatar.com/" target="_blank" rel="nofollow">Gravatars in site comments. These user pictures are tied directly to a person’s email address, meaning they can be used across a wide variety of sites that plug into the Gravatar API. Though the company behind Gravatar was once an independent entity, it was eventually href="http://blog.gravatar.com/2007/10/18/automattic-gravatar/" target="_blank" rel="nofollow">purchased by WordPress in 2007 and now serves 20 billion images a day to WordPress blogs and others around the internet.

Because it was purchased by WordPress, href="http://codex.wordpress.org/Using_Gravatars" target="_blank" rel="nofollow">some methods of gravatar integration using the world’s most popular content management platform are as easy as updating some settings in the WordPress Dashboard. Other implementations make use of plugins in order to place gravatar pictures throughout other sections of WordPress templates and designs.

Enabling Gravatars and Other User Pictures via the Dashboard

class="alignright border" src="http://www.webhostingsecretrevealed.net/images/2012/0621-2.jpg" alt="Gravatar Homepage" width="250" height="225" /> Since its purchase of Gravatar five years ago, WordPress has tightly integrated these user pictures into its administrative interface. In fact, in the most recent versions of the WordPress software, it is the only option for displaying a user picture next a comment they’ve made on a blog entry.

To enable Gravatar support in WordPress comments, a few simple steps must be followed using the WordPress dashboard. Once logged into the software, click the “Settings” heading in the WordPress Dashboard software. When this category has been expanded click on “Discussion” and the administration panel for user comments will open.

This page contains several settings, ranging from required comment information to the way WordPress links to sites which mention your blog entries. The last set of settings is dedicated to Gravatars, though it is only labeled as “Avatars” for users of WordPress 3.0 or higher.

This group of settings allows WordPress blog owners to display which avatars are paired with comments, which ones are censored, and what should be done if a commenter has not signed up for the Gravatar service and defined a picture for themselves. Below are a list of settings and how to properly fill them out to enhance the appearance of comments and the personality of those making them.

Avatar Display

This is a relative straightforward option. Those WordPress users who want to display Gravatars in comments will choose “Show Avatars.” Those who don’t will select the other option.

Maximum Rating

Gravatar allows their users to self-rate the photos they have uploaded for use as their global avatars on WordPress blogs and other websites. These ratings generally follow those that are assigned to movies, with a “G” rating being the lowest and an “X” rating indicating adult content which is inappropriate for some internet users.

This is an important setting to pay attention to when enabling Gravatars. It’s important to note that there is no real limit on what a user can upload as their avatar. While most companies ban explicit images, the Gravatar rating system as allowed the company to permit those images, leaving display of them up to individual website owners. Operators of family-oriented websites, or simply those who wish not to offend the majority of their readers, should pick a Gravatar rating which will keep explicit material off their website and out of their comments. Generally, this would mean restricting display of user pictures to those rate PG-13, R, or G.

Default Avatar

Even though the Gravatar service serves up 20 billion images a day to blogs around the world, there are still a vast number of people who do not have a Gravatar assigned to their email address. Comments by these authors can be handled in a number of ways.

First and foremost, WordPress offers some static image options that will display the same default image every time a Gravatar-less user comments on a blog post. These can include a blank white image, a “Mystery Man” image that shows the outline of a geometric person, or the standard Gravatar logo. Because these are static images, they will appear the same way every time a user comments without a Gravatar. That’s fine for some sites, but still others prefer something that changes based on a per-user basis and helps to identify the commenter.

For those WordPress users, the Dashboard offers a number of dynamically generated images for display in situations where a commented lacks a Gravatar. These images are generated on the fly using a commenter’s name, website, and email address information. They will be consistent every time the same user (with the same email address) leaves a comment, making them a sort of Gravatar alternative.

The WordPress Dashboard allows for several types of dynamically generated comment avatar images:

  • Identicon, a geometric pattern based on a user’s information
  • Wavatar, which creates a unique smiley face based on this information
  • MonsterID, a dynamically generated image that looks a bit monstrous in comments
  • Retro, which uses block shapes to create face-like images based on user data

After Gravatars have been enabled, rating limits have been set, and a default image type has been chosen for commenters who lack a Gravatar, it’s time to save these preference in the Dashboard and focus on customizing the comments template to display these new, personal images.

Bringing the Gravatar to WordPress Comment Templates

For the default themes included with every download of the WordPress software, Gravatar images are automatically included in the comments template and will automatically show up once a user has enabled them in the “Discussion” settings panel. For custom-designed themes, or downloaded themes that have left this code out of the comments template, inclusion of the Gravatar images is relatively simply

To bring the Gravatar image into comments, a simple PHP include must be added to the “comments.php” template located within the selected theme’s home directory of template files. The code looks like this:

< ?php echo get_avatar( $id_or_email, $size = ‘PIXEL-SIZE’, $default = ‘DEFAULT-IMAGE’ ); ? >

There are several parameters to know when adding this code to the comments template in order to customize the display of the Gravatar. These are as follows:

$id_or_email This variable cannot be removed or customized, as it pulls the commenter’s email address from the comment form and turns that into their Gravatar URL. Every Gravatar is constructed using the same basic code, and leaving this out will cause the default image to be displayed next to every commenter’s name, regardless of their status as Gravatar user or non-user.

$size This is set in pixels, and determines the size of the square Gravatar image generated by the code. If the image is to be 50 pixels square, the variable would be constructed as follows: $size = ’50’, this will also be added into the Gravatar URL, and the server will only send an image to the WordPress blog that is the size they’ve demanded via this PHP include.

$default Even though WordPress allows users to specify a default image for non-Gravatar commenters, this setting can be overridden via the PHP include tag used to display the images in comments. That’s because the default URL construction of a Gravatar image actually allows for a customized default image as part of its parameters. This variable can be set to a default image custom-designed by the site owner, overriding the “Mystery Man” or Gravatar logo. It’s great for making a site’s design and images consistent.

For WordPress users who prefer one of the standard dynamic or static images, no default image needs to be specified in the PHP tag. The entire “$default” construction can be deleted entirely, and this will cause WordPress to display the default image that was defined by the site owner in the Dashboard during the setup process.

Using CSS to Style the Gravatar Image Output

WordPress generates Gravatars will relatively predictable CSS “class” code that allows users to easily style the images produced on the fly. When using the standard PHP tag inclusion method to display Gravatars, the resulting “img” tag contains the following code:

class=’avatar avatar-SIZE’

In the example above, the Gravatar was told to be 50 pixels square, meaning the code would be printed on the comments page as “avatar avatar-50.” WordPress template designers can then easily include the CSS styling code in the theme’s “style.css” stylesheet file, and save the changes to the server. The image will be immediately rendered using the new CSS code and the Gravatar will be seamlessly integrated with WordPress comments.

Using Plugins to Insert the Gravatar Throughout a WordPress Theme

The great thing about WordPress is that the software’s features are not limited by what Automattic includes in the standard Dashboard. Indeed, WordPress has the largest community of plugin developers, and downloadable plugins, of any content management system in the world That bodes well for a number of functions, but especially for the inclusion of gravatars in other site elements.

Using the plugin community, there are some great ways to increase the visibility of this small identifying image, as well as encourage users to get their own so that a “default” image is no longer necessary. Here are some of the best ways to integrate Gravtars into a theme using plugins.

Recent Comments This plugin, which has been around since long before Gravatars were a standard option in the WordPress Dashboard, displays al its of recent comments in the sidebar of a WordPress site. Every comment is paired with the author’s Gravatar, meaning that even non-commenting users will see this image and want to get one of their own. The image is styled within the WordPress Plugins and Widgets administration panel, and can be optionally turned off if users wish.

Gravatar Signup Encouragement No one likes seeing that default image for users who haven’t yet joined the Gravatar service, and so this plugin seeks to remedy that by encouraging users to take the next step. When a user posts a comment and is not part of the Gravatar service, this plugin displays a short message encouraging them to visit the website an create an account. It even includes an off-site signup form, pre-filled with the offending user’s email address. This is a great way to encourage more user interaction and personality on a WordPress blog that has recently adopted the Gravatar standard.

Extended Gravatar This plugin turns a Gravatar into a Facebook-like popup that displays a larger version of the user-selected image, along with their name and contact details that they have made public to other commenters. It’s a great way to enable greater user interaction and foster more discussion using something as simply as a user image.

Adding User Pictures to Comments Encourages Commenting

Integrating the Gravatar image into WordPress comments isn’t just a fun way to see user pictures and enhance the appearance of comments. It actually encourages greater user interaction with a site, as the appearance of pictures turns commenters from mere blocks of text into real, relatable people who all enjoy the same type of dynamic blog content. Users will enjoy being able to customize this image and control the way they appear to others on your blog and others.

As commenters become more involved, and commenting becomes more common, a blog’s reach and relevance will increase. This has the added effect of increasing search engine rankings and a site’s perceived authority. All because of a simple, user-defined image that can be enabled in the WordPress Dashboard.

Things to Keep in Mind

class="border" src="http://www.webhostingsecretrevealed.net/images/2012/0621-3.jpg" alt="Gravatar Images" width="750" />

While the community-bulding benefits of a Gravatar are important (so important that WordPress bought the company which developed it), even more important is ensuring that users are safe from explicit images and aren’t driven away out of pure offense. Remember to always set the “maximum rating” and default avatar options with care, as these can be the equivalent of an unexpected expletive during prime time television for some more sensitive readers and younger commenters.

Other than that, enjoy your new Gravatar and have fun with the site’s universal appeal and comment-encouraging presence! For those just getting started with WordPress, our series oftitle="WordPress Beginner Guide" href="http://www.webhostingsecretrevealed.net/category/blog/wordpress-blog/"> WP how-to guide is a good place to start.


Page 23 – Web Hosting Secret Revealed