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

samedi 12 novembre 2016

How to Add a Printer Friendly Option to Your WordPress Posts



Often users want to print articles they find interesting. By default, WordPress itself and most WordPress themes would print your page as it is, with all the graphics, colors, and text in sidebars. In this article, we will show you how to add a printer friendly option to your WordPress posts.


Adding a printer friendly option to WordPress posts


Why and When You Need a Printer Friendly Option for WordPress Posts?


Some WordPress themes come with a separate CSS stylesheet for printing. This stylesheet is used when a user prints a page. Other WordPress themes, may not change your site’s appearance when a user prints it.


Usually this results into users printing all the images, sidebars, headers, menus, etc. Most of the time it is not very pleasant to read or look at.


A typical print preview with sidebars forms all printed


You can see how your WordPress theme handles print by pressing CTRL+P when looking at a page from your site. Your browser will show print preview of your site.


If your theme shows your site as it appears in the browser, then it is not handling print any differently.


In that case, you can use a printer friendly option on your WordPress site. It will not only make your content printer friendly, it will also encourage users to print with an on-screen print icon.


We will be showing you two plugins that can add a print option to WordPress, and you can choose the one that best suits your need.


Method 1: Add Print Button in WordPress with Print Post and Page Plugin


This method is recommended for users who do not want to add code to their WordPress theme files.


First thing you need to do is install and activate the Print Post and Page plugin.


Upon activation the plugin will add a new menu item labeled ‘Print’ to your WordPress admin bar. Clicking on it will take you to the plugin’s settings page.


Print settings


Here you can choose the print icon size and color, text to accompany the icon, and print alignment. Optionally, you can add custom CSS that you want to include into your print template.


Don’t forget to click on the ‘Save and Activate’ button to store your plugin settings.


You can now visit your WordPress site and you will see a print button on your single posts.


Print button in WordPress post


However, the plugin does not automatically adds print button to your WordPress pages. You will need to add [printicon align="left"] shortcode to your WordPress pages to display the print icon on pages.


Method 2: Adding Printer Friendly Option Using WP-Print


First thing you need to do is install and activate the WP-Print plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Settings » Print to configure plugin settings.


Print Options


You can display print icon with text, just the icon, or just the text. You can choose between two icons, and you also change the text that appears with the icon.


Under print options, you will be asked if you want to print comments, links, images, or videos. By default, the plugin does not print comments and videos. You can change that if you want the plugin to print comments and videos as well.


At the bottom of each printed post, the plugin will add a disclaimer/copyright text. By default, it will show your site’s name. You can change that to anything you want, and you can also use HTML tags inside the disclaimer field.


Don’t forget to click on the save changes button to store your settings.


Now comes the tricky part. The plugin will not actually add the print button into your posts. You will have to manually edit your WordPress theme files to add the button.


Depending on your theme, you may need to add the code into single.php, page.php, archive.php, content.php, etc.


Locate the line in your theme template that looks like this:


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

Below this line, you need to add the following code where you want to display the print button:



<?php if(function_exists('wp_print')) { print_link(); } ?>

That’s all, you can now visit your website and you will be able to see the print button.


Print this button


Sometimes you may have content that you do not want to be included into the print version. Simply wrap that content between [donotprint] and [/donotprint] shortcode, like this:



[donotprint]This text will not be displayed when printing[/donotprint]

We hope this article helped you add a printer friendly option to your WordPress posts. You may also want to see our guide on how to add PDF download for posts in WordPress.


If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


The post How to Add a Printer Friendly Option to Your WordPress Posts appeared first on WPBeginner.







How to Remove the Password Reset / Change option from WordPress



Are you looking to remove the password reset option in WordPress? By default, WordPress allows users to reset/change password by providing their email address. Sometimes you may want to disable password reset option in WordPress. In this article, we will show you how to remove the password reset / change option from WordPress.


Removing password reset option from WordPress


Why Remove Password Reset/Change Option From WordPress


If you allow user registration on your WordPress site, then password reset option allows user to recover lost passwords. Normally, you wouldn’t want to change that.


However, in some usage scenarios you may want to remove this option for specific users or user roles on your WordPress site.


For example, if you have created a temporary account for someone or if you have created a demo site where users can login with a demo username and password.


The easier solution will be to just remove the password reset link. But some savvy users may already know the URL to access the password reset form.


Having said that, let’s see how you can easily remove password reset/change option from WordPress.


Method 1: Disable Password Reset/Change Option Using Plugin


The plugin method is better and easier. It allows you to disable password reset option for specific user roles or even individual users.


This way you can still control and provide password reset feature for some trusted users or user roles.


First thing you need to do is install and activate the Plainview Protect Passwords plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Settings » Protect Passwords page to configure the plugin settings.


Protect password settings


Simply select the user roles or individual users to disable their password change or reset option.


There is also an option to exempt individual users. This option is useful if you want to disable password reset option for all users except yourself.


Don’t forget to click on the save changes button to store your settings.


You can see the plugin in action by visiting the WordPress login page and clicking on ‘Lost your password?’ link. It will take you to the password reset page where you can try entering the username or email address for a user who does not have password reset option.


You will see an error indicating that password reset is not allowed for this user.


Password reset disabled for this user


Method 2: Manually Disable Password Reset Option From WordPress


This method requires you to add code to your WordPress site. It is not recommended for beginner level users.


First thing you need to do is open a blank text file using a text editor like Notepad. Paste the following code inside this file.



<?php
/*
* Plugin Name: Disable Password Reset
* Description: Disable password reset functionality. Only users with administrator role will be able to change passwords from inside admin area.
* Version: 1.0
* Author: WPBeginner
* Author URI: http://wpbeginner.com
*/

class Password_Reset_Removed
{

function __construct()
{
add_filter( 'show_password_fields', array( $this, 'disable' ) );
add_filter( 'allow_password_reset', array( $this, 'disable' ) );
add_filter( 'gettext', array( $this, 'remove' ) );
}

function disable()
{
if ( is_admin() ) {
$userdata = wp_get_current_user();
$user = new WP_User($userdata->ID);
if ( !empty( $user->roles ) && is_array( $user->roles ) && $user->roles[0] == 'administrator' )
return true;
}
return false;
}

function remove($text)
{
return str_replace( array('Lost your password?', 'Lost your password'), '', trim($text, '?') );
}
}

$pass_reset_removed = new Password_Reset_Removed();
?>

Save this file as disable-password-reset.php on your desktop.


Now you need to upload this file to your WordPress site. You will need an FTP client to do that. See our guide on how to use FTP to upload WordPress files.


Connect to your website using the FTP client and then go to the plugins folder. The plugin’s folder is located inside /wp-content/ directory.


Plugins folder on a WordPress site


Upload disable-password-reset.php file from your computer to the plugins folder on your WordPress site.


Now you need to login to your WordPress admin area and visit the plugins page. You will notice a new plugin titled ‘Disable Password Reset’ in your list of installed plugins. Click on the activate link below the plugin.


Activate Disable Password Reset plugin


That’s all, activating the plugin will disable password reset option for all users including administrators. Administrators will be able to change passwords from the admin area, but they will not be able to reset password from the login screen.


We hope this article helped you learn how to remove the password reset/change option from WordPress. You may also want to see our list of 13 plugins and tips to improve WordPress admin area.


If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


The post How to Remove the Password Reset / Change option from WordPress appeared first on WPBeginner.







Why Free Web Hosting is Not the Best Option



alt="Why Free Web Hosting is Not the Best Option" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/server2-500x375_c.jpg" />

Starting up a website is easy, effortless and can be done free of charge with trusted sites like WordPress.com and Blogger. While this may sound like a great option for people who are blogging as a hobby, if you want to become a serious blogger, create a useful site or go into business online, you need to understand why it’s not the best choice. Here are the eight major pitfalls of free web hosting:

1. Limited space

style="text-align: center;">class="aligncenter size-full wp-image-6499 border" alt="Full House" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/disk-full.jpg" width="750" height="500" srcset="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/disk-full.jpg 750w, http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/disk-full-300x200.jpg 300w" sizes="(max-width: 750px) 100vw, 750px" />

You may not be worried about the size of your website right now, but if you are planning to post regularly, include supporting images and eventually add video or audio, bandwidth is an important consideration. Free web servers only provide limited amounts of space. Blogger, for example, has a total of 1GB of image storage and a limit of 1MB in page size. There’s also a 250MB size limit to any photos you upload through your mobile device. WordPress.com provides a total of 3GB of storage for your files and images. That may sound like a lot, but when you consider that you should be uploading high quality, pinnable images with every post if you want to be impactful, you’ll use up that space fairly quickly.

If you surpass that, you can upgrade either service for a fee – but if you’re going to spend, why not start off with the better option of investing in a professional web host?

2. Limited design and functionality

style="text-align: center;">class="aligncenter size-full wp-image-6503 border" alt="dull color" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/dull-color.jpg" width="750" height="321" srcset="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/dull-color.jpg 750w, http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/dull-color-300x128.jpg 300w" sizes="(max-width: 750px) 100vw, 750px" />

To capture an audience, a stand out design is necessary.

As your blog grows, you may want to offer advertising on your site, add social media sharing or even offer useful functions, like attaching related links to your post, with the right plugins. Blogger, WordPress.com and other blog hosting service are limited in the number of designs they offer and plugins or widgets they allow you to use. In addition, there may be compatibility issues with getting approved plugins to work properly. While there are workarounds for those more adept in HTML and programming, backend updates like these are more challenging when using free hosting services. They also can prohibit some 3rd party services. For example, WordPress.com will not allow you to run Rafflecopter, which allows you to easily administer giveaways, an excellent way to generate traffic and work with brands. Paying for hosting eliminates these problems and provides flexibility to grow, expand and customize your site or blog as you see fit.

3. It doesn’t look professional

Whether you are blogging or getting online for a fledgling business, you will want to promote your site, work with brands, or offer products and advertising. Free web hosting sites look unprofessional and potential clients and employers may pass you up for opportunities. Keep in mind, too, that if you sign up with a free hosting service provider, you’ll need to have your own email without the hosting name it, making it harder for your contacts to remember you.

4. Limited monetization and opportunities

Many people start blogging with the idea of attracting income, a highly achievable goal, however, free web hosting providers can prohibit or restrict your ability to monetize your blog. In fact, they can actually cause you to lose income. For example, Blogger’s free service will not allow you to post any ads on your site that are not Google ads, which can be difficult to earn an income from. At WordPress.com, on the other hand, you cannot use Google AdSense or any third party advertising with their free service. You are also expressly forbidden from running sponsored or paid posts or content. (See their advertising policy href="http://en.support.wordpress.com/advertising/" target="_blank">here.)

5. It can hurt your site’s search engine performance

Google owns Blogger, which may help some Blogger sites gain better ranking – how much it does, though, is still a topic of debate. However, other sites are not in question – free hosting provides no assistance whatsoever for search engine optimization.

In fact, a number of common free hosting problems can actually harm your search engine performance.

Slow website speed, website going down too often, having your “top level” domain hosted outside your country, database errors and caching issues can hurt your search engine optimization efforts, especially on Google. Another problem is that low quality spam sites, which are often hosted on free servers, share your web hosting and can lead to poor ranking for your site in any search engine. You can avoid many of those issues with quality, paid-for web hosting.

6. You’re at the mercy of your web service provider

style="line-height: 1.5em;">Many years ago, I had a web client who found a strange page on her site. I logged into her host to discover that her hosting service had placed entire pages of ads on her website that we were unable to remove. It turned out to be a small line her contract and we were powerless to disable this free advertising. Your hosting contract can cover other restrictions and terms you may not like.

style="line-height: 1.5em;">For example, both Blogger and WordPress.com reserve the right to advertise on your blog and can legally distribute and modify the material on your blog. You also to carefully read the rules and regulations, right down to the fine print, of Blogger, WordPress, or any other free hosting services provider and strictly adhere to them or your site can and will be shut down. This is, of course, true of paid web hosting as well, but there are far less rules to adhere, other than the standard laws of the land, such as spam compliance policies. When reading the terms of service for style="line-height: 1.5em;" href="http://www.google.com/intl/en/policies/terms/" target="_blank">Bloggerstyle="line-height: 1.5em;"> and style="line-height: 1.5em;" href="http://en.wordpress.com/tos/" target="_blank">WordPress.comstyle="line-height: 1.5em;">, remember those are general terms. There are many links to more detailed information about what you can and cannot do with your site. Finally, you will only get limited a amount of customer service – if any – for your technical difficulties, whereas paid services generally offer a great deal of support.

7. Security risks and outages

style="text-align: center;">class="aligncenter wp-image-6504 border" alt="security" src="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/security.jpg" width="750" srcset="http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/security.jpg 640w, http://whsr.webrevenueinc1.netdna-cdn.com/wp-content/uploads/2013/09/security-300x185.jpg 300w" sizes="(max-width: 640px) 100vw, 640px" />

In 2011, Blogger.com did an update that unintentionally locked users out of their sites overnight. That doesn’t sound too bad, but what if you were launching a game or book, timed just at the hour of the lockout? What if you suddenly got a spam attack that overloaded your account?

It’s as simple as this: you get what you pay for.

Free hosting providers simply cannot afford to provide you the security you need, which is part of the reason why the more trustworthy providers limit functionality. Remember that client I discussed in the last bullet? While searching her site, I stumbled into other hosting clients on the same server. Hopefully, poorly secured web servers like that are a thing of the past, but you don’t want to expose your site to poor security that’s not robust enough to survive a full-blown malware attack.

8. Transferring your site later is more difficult

You might think you’d first like to try this service to see if blogging or a website is a good fit for you. I have no argument with that, but keep in mind the future hassles that transferring to a new domain will bring such as downtime while your site is transferred. Exporting and importing can go flawlessly, or unforeseen errors can make it a nightmare. Transferred content can contain glitches that are time consuming to fix. You also need to make sure that your permalinks are consistent between services, your RSS feed doesn’t lose subscribers and that all your redirects still work for pages that have been moved or removed. Finally, you will need to redirect your readers to the new site. That’s all achievable, but you can save all that effort by starting with a paid web host.

Free web hosting has a lot of pitfalls, while paid web hosting nowadays is fairly affordable. You can register your domain name for less that a year, and there are many high-quality hosting services that have packages starting under a month. You’d be smart to do some research first, and href="/blog/web-hosting-guides/top-20-questions-to-ask-a-web-host-before-you-sign-up/">ask the right questions before signing up for a paid service, but investing a small amount of money into web hosting will provide you security and flexibility, and put you in full control of your website.

Image credit: href="http://www.flickr.com/photos/kohara/" target="_blank">Kohara and href="http://www.flickr.com/photos/protohiro/" target="_blank">protohiro.


Page 18 – Web Hosting Secret Revealed