Sunday, October 13, 2013

6 Useful WordPress Hacks

In line with Article 10 WordPress hacks easy to implement, discover six new useful hacks for your WordPress.

Definition WordPress hack: Element coded often inserted in the "function.php" file of your theme. The benefits of a hack are that it is much faster than a plugin, do not overload your blog and usually does not require updating.

Detect Visits In The Origin Mobile

Mobile browsing on the internet is increasing, so it is very useful to detect visits from users "mobile" and that, in order to redirect to a more appropriate and dedicated navigation smartphone or tablet page. To do this, you must firstly obtain complete information on Detect mobile browser website and transfer it in the directory of your theme, then change your header.php by placing the following code (do not forget to change the redirect page /your-website.com):

include('mobile_device_detect.php');
$mobile = mobile_device_detect();
if ($mobile==true) {
 header( 'Location: http://your-site.com/?theme=Your_Mobile_Theme' ) ;
}

Automatically resize The Images

If you use many images on your blog, then you know how tedious it is to have to always resize your images manually. Use this hack to automatically resize an image of your choice (width and height) for a more organized look. Just copy the following source code: script (click here) in a new document called "timthumb.php", place it in a folder on your site (eg: /scripts/) and call the image like this:

<img src="/scripts/timthumb.php?src=/images/the-name-of-your-image.jpg&h=150&w=150&zc=1" alt="" />

Show Your Best-Of Annual

This hack allows your visitors to see the top 5 most commented articles on your blog over a year. This is a great way to give back to your second chance. To view a different time, just change the dates. ? Place the following code in your sidebar or anywhere else:

<h2>My 5 most commented articles in 2011</h2>
<ul>
<?php
$result = $wpdb->get_results("SELECT comment_count,ID,post_title, post_date FROM $wpdb->posts WHERE post_date BETWEEN '2011-01-01' AND '2011-12-31' ORDER BY comment_count DESC LIMIT 0 , 5");
foreach ($result as $topten) {
 $postid = $topten->ID;
 $title = $topten->post_title;
 $commentcount = $topten->comment_count;
 if ($commentcount != 0) {
 ?>
 <li><a href="<?php echo get_permalink($postid); ?>"><?php echo $title ?></a></li>
 <?php }
}
?>
</ul>

Only Allow Your IP On Wp-Admin

If you do not have a collaborative blog and therefore multiple writers, you should be the only one allowed to visit the wp-admin directory. To increase the security of your site, enter your static IP address line 8. You can also add other IP addresses, if necessary, by creating a new line. Place the following code in your htaccess file.

AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName "Example Access Control"
AuthType Basic
<LIMIT GET>
order deny,allow
deny from all
allow from xx.xx.xx.xx
</LIMIT>

An Insert Author Bio on Each Item

It is sometimes useful to view the Bio of the author of an article, whether on a multi-author blog and when your articles are listed. If your theme does not offer this feature, insert the following code in your functions.php file. The biography of the author will be automatically displayed at the end of each article:

function get_author_bio ($content=''){
 global $post;
$post_author_name=get_the_author_meta("display_name");
 $post_author_description=get_the_author_meta("description");
 $html="<div class='clearfix' id='about_author'>n";
 $html.="<img width='80' height='80' class='avatar' src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(get_the_author_email()). "&default=".urlencode($GLOBALS['defaultgravatar'])."&size=80&r=PG' alt='PG'/>n";
 $html.="<div class='author_text'>n";
 $html.="<h4>Author: ".$post_author_name."</h4>n";
 $html.= $post_author_description."n";
 $html.="</div>n";
 $html.="<div class='clear'></div>n";
 $content .= $html;
 }
return $content;
}
add_filter('the_content', 'get_author_bio');

Redirect Your RSS Feeds To FeedBurner

Whenever a user follow a link from your default stream (http://www.your-site.com/feed), it will be redirected to, your FeedBurner feed (http://feeds.feedburner.com/your-site). With this hack, even a user of your RSS feed origin; will be automatically redirected to FeedBurner. Place the following code in your htaccess file.

# temp redirect wordpress content feeds to feedburner
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
 RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
 RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/votre-site [R=302,NC,L]
</IfModule>

Sources and resources for more hacks: Webdesignledger.


See more wordpress tutorial

Friday, October 11, 2013

Inform your subscribers every new article

There Newsletter but what if your blog subscribers are not registered?

Here's A Hack For Automatically Send An Email To Your Subscribers From WordPress Blog In Every Issue From a New Article

Just insert the following code in the "function.php" file of your theme. Remember to save the original file before making any changes.

function email_members($post_ID)  {
    global $wpdb;
    $usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;");    
    $users = implode(",", $usersarray);
    mail($users, "New WordPress recipe online!", 'A new recipe have been published on http://www.wprecipes.com');
    return $post_ID;
}

add_action('publish_post', 'email_members');

Once saved, all registered users will receive an email when a new post is published.

Discover also: 10 WordPress hacks easy to implement

Sourcewprecipes.com

Thursday, October 10, 2013

Add Tooltips in your articles

A Tooltip is a small message, often in a bubble that appears when hovering over an item.
You are writing the text and it contains a lot of acronyms, abbreviations or technical terms, you want to simplify understanding and allow your reader to immediately find the meaning?

Use a Tooltip

Tooltip WordPress plugin is for you. It adds to the WordPress shortcodes allowing utilsation tooltip and an insert button in tinyMCE (text editor).
To add a Tooltip on a word or phrase, select the text and click the yellow bubble BD your text editor, a panel then appears:

Use a Tooltip

Tooltip Content: The tooltip text to display.
Text: If no text selected before.

Url: Can optionally contain a url link with hypertext effect.



See more post

  1. WordPress SEO Plugin - Discover LiveOptim
  2. Choosing Your Hosting
  3. 10 +1 Free WooCommerce Plugins
  4. CommentLuv Premium, do the test

8 PDF plugins for WordPress

Portable Document Format (PDF) is an open standard for document exchange. This file format created by Adobe Systems in 1993 is used for representing documents in a manner independent of application, hardware and operating systems software. Each PDF file encapsulates a complete document with a set fixed shape description, including the text, fonts, graphics and all necessary information to display.

8 PDF plugins for WordPress PDF is a file format to allow viewing the information exactly as you planned and that, on all platforms. This is the perfect size to allow your visitors to download or print menus, articles or any other document type.
If you want to add this feature on your site, there are a number of free WordPress plugins that can simply turn your pages and articles in PDF format.


Anthologize
Anthologize is a free, open-source. Take your WordPress blog posts, but also content from external sites, or create new content directly anthologize. Then in the preview, change the order, structure it for export in several formats of your choice: Ebook formats, but also in PDF, EPUB and TEI.

Print Friendly And PDF Button
Button #1 to print to PDF on your WordPress site. With Print Friendly, easily print your pages without coding or css. Fast, easy and professional.

PDF And PPT Viewer
PDF and PPT Viewer help you embed PDF documents and PowerPoint presentations easily. Does not require Flash to be installed on your computer, it is pure JavaScript! The plugin also allows the use of Google Docs.

PDF24 Articles To PDF
This plugin allows your readers to convert to a PDF one or more items of your document. PDF24 fits a small box either in all your articles in the sidebar on the top or bottom of each page or anywhere in your blog.

Kalin's PDF Creation Station
Kalin's PDF is highly configurable to PDF documents from any combination of pages / articles, or even to add a link to any PDF document to download.

Make PDF Newspaper
With Make PDF Newspaper, create a few clicks newspaper edition in PDF format for your WordPress blog.

RV Embed PDF
RV Embed PDF automatically includes a PDF file into your page or in your article when you use the WP "Add Media".

Google Docs Viewer
Once Google Docs Viewer enabled, you can easily convert a link to a PDF document or through Google Docs by simply replacing "http" in the URL with "gDoc" (gdocs or if it is an https).

Tuesday, October 8, 2013

10 WordPress hacks easy to implement

The benefits of a plugin, without the disadvantages: the Hack

Definition WordPress Hack: Element coded often inserted into the "function.php" file of your theme. The benefits of a hack are that it is much faster than a plugin, do not overload your blog and usually does not require updating.

10 WordPress Hacks Easy To Put In Work

While the hack is convenient, but nevertheless he asked to put their hands in sensitive and critical files to the proper functioning of your blog, so needless to remind you of the absolute necessity to save before handling ...
10 WordPress hacks easy to implement

Edit The Riddler Gravatar
If a user who comments on your blog is not listed on, Gravatar.com is the default gravatar appears. You can of course change the default gravatar from the settings page, but if you do not like those that are available, you can customize one for your blog.
Upload your own gravatar in your Pictures folder and paste the code in "functions.php". (Change the name of the image file that you see in the code "yourname-gravatar.jpg" by one of your personalized Gravatar)

add_filter( 'avatar_defaults', 'newgravatar' );
    function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo('template_directory') . '/images/yourname-gravatar.jpg';
    $avatar_defaults[$myavatar] = "Build Internet";
    return $avatar_defaults;
}
The Google detect Visitors And Greet
Place the following code at the point where you want the message to appear.

<?php
if (strpos($_SERVER[HTTP_REFERER], "google") == true) {
 echo "Welcome Guest Google!";
}
?>
The use shortcodes In Your Widgets
If you want to add shortodes in a widget, you simply add a filter in your functions.php file. You can now use your shortcodes in both pages, articles and widgets on your blog.

<?php add_filter('widget_text', 'do_shortcode') ?>
Automatically Delete The Links In The Comments
When a user places a link in a comment, WordPress automatically converts clickable link. If you want to disable this feature, add the following code in your "functions.php" file.

remove_filter('comment_text', 'make_clickable', 9);
Configure the Default HTML Editor In WordPress
You know that the default editor for WordPress is the visual editor, if it does not suit you and you want to make the HTML Editor your default editor, simply add the following code always in your "File functions. Php ".

add_filter('wp_default_editor', create_function('', 'return "html";'));
The Exclude Pages In The WordPress Search
WordPress by default also included your pages in search results, if you want to exclude results and view only your items, add the following code in the "functions.php" file. This code places the pre_get_posts filter and therefore in the case below, it will only display the contents of the Blog excluding pages.

add_filter( 'pre_get_posts', 'tgm_exclude_pages' );
/**
 * tgm_exclude_pages Fonction.
 *
 * This function changes the WordPress application to remove the search pages.
 *
 * @param mixed $query Query original
 * @return $query Query modified
 *
 */
function tgm_exclude_pages( $query ) {
 if ( $query->is_search )
 $query->set( 'post_type', 'post' );
 return $query;
};
Edit The Mise En Cache Via. Htaccess
If you want to decrease the loading time of your files "images, CSS, PDF, JS", add the following code to your file. "Htaccess" (FTP only). Using this code, the main static files will be cached to speed up load times.

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##
Replace In 1 Times In All Content From Your Articles
How to add or replace text or link in all your posts and this at once. You can do this by adding the following code in your "functions.php" file. In the case below, the text "wordpress" will be bold and "wordpress hack" will be wearing a link to "wordpress.com".

function replace_text($text) {
 $text = str_replace('WordPress', '<strong>WordPress</strong>', $text);
 $text = str_replace('WordPress hacks', '<a href="http://www.wordpress.com">WordPress hacks</a>', $text);
 return $text;
}
add_filter('the_content', 'replace_text');
The Eliminate Spam From Your Comments
You can block spammers instead of marking as spam. The following code rejects any comment posted from a browser, which does not have “Referer” in general it, is a bot. The code checks the "HTTP_REFERRE" and if it is not defined or incorrect, execution is stopped with the appropriate message. Paste the following code in your "functions.php" file.

function check_referrer() {
 if (!isset($_SERVER['HTTP_REFERER']) || $_SERVER['HTTP_REFERER'] == &quot;&quot;) {
 wp_die( __('Thank you to enable the referrer in your browser, or, if you are a spammer, bye bye!') );
 }
}
add_action('check_comment_flood', 'check_referrer');
Delete the symbol [...] Extracts From Your Messages
If you want to get rid of this symbol [...], you only need to insert the following piece of code in the "functions.php" of your theme.

function trim_excerpt($text) {
 return rtrim($text,'[...]');
}
add_filter('get_the_excerpt', 'trim_excerpt');
Hack all good ;)

Monday, October 7, 2013

Disable publishers Theme & WordPress Plugin

No Key To My Code
After long hours of work, then you just set up a WordPress site for a customer, and/or you are more directors on the site. You do not want them to change the code of the theme or plugin. There is a simple way to achieve this.

Add Code
Open the "wp-config.php" to the root of the wordpress folder and add this line file:

define('DISALLOW_FILE-EDIT', true);
Back then visit the WordPress table edge to see the immediate disappearance of the menu "Editor" in the category of "Appearance" menu of the site.

Sunday, October 6, 2013

10 +1 Free WooCommerce Plugins

While version 2.0 WooCommerce is approaching and while developers furbish their plugins and extensions for maximum compatibility, discover a list of 10 + 1 free WordPress plugins for your WooCommerce.

10 +1 Free WooCommerce Plugins

10 + 1 WooCommerce Extensions For Free

WooCommerce Grid / List Toggle
WooCommerce Grid / List toggle is a simple plugin which adds a Grid / List toggle to your product archives allowing users to, you guessed it, toggle between grid / list views of your products.

WooCommerce Grid / List Toggle

WordPress Lister for eBay
WP-Lister connects your WooCommerce, Jigoshop, WP e-Commerce, Shopp or MarketPress site with your eBay Store. You can select multiple products right from your products page, select a profile to apply a set of predefined options and list them all on eBay with just a few clicks.

WordPress Lister for eBay
Click to Zoom

Pushover for WooCommerce
Pushover for WooCommerce integrates WooCommerce with the Pushover notifications app for Android and iOS.
After installation and setup automatic notifications can be sent to your device for new orders, low stock, backorder and out of stock notifications.

Pushover for WooCommerce


WooCommerce Accepted Payment Methods
WooCommerce Accepted Payment Methods extends the WooCommerce settings allowing you to specify which payment methods your store accepts.
The specified payment methods can then be displayed in the frontend via a widget, a shortcode or by adding a template tag directly to your theme.
WooCommerce Accepted Payment Methods

WooCommerce Pay To Upload
Allow customers to pay to upload a file. Once a WooCommerce order has been marked as processed, a file upload screen will appear on the order details page.

WooCommerce Menu Bar Cart
This plugin installs a shopping cart button in the navigation bar. The plugin takes less than a minute to setup, and includes the following options:
  • Display cart icon, or only items/prices.
  • Display items only, price only, or both.
  • Display always, or only when there are items in the cart.
Finally, the cart automatically conforms to your site’s styles, leaving you with no extra work.

WooCommerce Menu Bar Cart

WooCommerce Custom Product Tabs Lite
This plugin extends the WooCommerce e-commerce plugin by allowing a custom product tab to be added to product view pages with arbitrary content, which may contain text, html or shortcodes.

WooCommerce Custom Product Tabs Lite

Order Delivery Date for WooCommerce
This plugin will allow the customer to choose an order delivery date on the checkout page. The customer can choose any delivery date that is after the current date. The plugin uses the inbuilt datepicker that comes with WordPress.

Order Delivery Date for WooCommerce

WooCommerce Customizer
WooCommerce includes a lot of filters so you can customize button text, labels, and more — but you have to write PHP code to use them. This plugin provides a settings page where you can add your customizations and save them without needing to write any code or modify any templates, which is helpful for quick change testing.

WooCommerce MultiLingual
This ‘glue’ plugin makes it possible to run fully multilingual e-commerce sites using WooCommerce and WPML. It makes products and store pages translatable, lets visitors switch languages and order products in their language.

WooCommerce MultiLingual


WooCommerce Admin Bar Addition
This small and lightweight plugin adds a lot of WooCommerce related resources to your toolbar / admin bar. It also links to all setting / tab pages of the plugin and generally makes shop administrators/ webmasters lives a lot easier. So you might just switch from the frontend of your site to ‘Payment Settings’ page or check recent ‘Orders’ etc.

WooCommerce Admin Bar Addition

Testimonials By WooThemes
Go a little more for the road ;) View the testimonials from your customers and what they have to say about your company and your services. This plugin offers evidence either a shortcode, a widget or integration directly into your template.

Source: http://www.woothemes.com/2013/02/13-nifty-free-woocommerce-extensions-you-might-not-know-about/
Copyright @ 2013 Johnny Gagnon blog. Designed by Templateism | Love for The Globe Press