Thirty per cent of the web powers with the most popular content management system (CMS) i.e. WordPress. This CMS obtains over 22 billion monthly page views. It offers more than 50 thousand plugins as millions of users demand new WordPress features each day.
WordPress has become the first choice among many individuals who run their own websites. Something that numerous clients stress over is matters to do with security. This is on the grounds that WordPress is an open source content. Hence, it is helpless against all way of attacks. Except security matters, there is so much that you should know to utilize WordPress to further your potential benefit.
The fame of WordPress has directed to a great number of tips accessible. These tips, hacks or tricks will show how you do lots of stuff. These tricks and WordPress hacks will drive your website to the supreme impending. Optimize the display and performance of WordPress with the minor changes in the WordPress code. However, most users are not developers thus do not have much knowledge with code. Here are some of the cool WordPress hacks that will enable you to get more from your WordPress website installation.
Hacks for Developers That Will Make WordPress Easier to Use for Them
It is a good idea to show related posts to help visitors find useful information and stay longer on the site. Not many developers know that they can effortlessly assimilate this function by default and download yet additional plugin that does that. Here are the steps instruction on how to do that:
If ($tags) { Echo ‘related posts’; $first_tag = $tags[0]->term_id; $args=array( ‘tag__in’ => array($post->ID), ‘showposts’=>5, ‘caller_get_posts’=>1 ); $my_query = new WP_Query($args); If( $my_query->have posts() ) { While ($my_query->have posts() : $my_query->the post(); ?>
WordPress theme support infinite scroll that is a Jetpack plugin feature. Infinite scroll WordPress trick will help readers approach the bottom of the page by automatically loading the new content on scroll down. You can add the following code to your functions file, by installing the Jetpack plugin and allowing infinite scroll feature.
add_theme_support (‘infinite-scroll’, array( ‘container’ => ‘content’, ‘footer’ => ‘page’, ) );
In the backend of WordPress add your own logo to the dashboard to personalize your installation. To modify client sites this is a great tip. Just paste the following code:
{code type=php} Add_action(‘admin_head’, ‘custom_logo’); Function custom_logo() {echo ‘’;}
Adding full-screen search overlay to your WordPress based webpage can make the search experience more clear and friendly. By installing the WordPress Full-Screen Search Overlay plugin you will acquire this valuable feature. You can simply activate the plugin as there are no settings for this. You can click on an existing search field or search button once the plugin is activated. After that, it will display the full-screen search overlay.
It becomes a boring task for the users to post comments manually and come back looking for reactions and replies. It is suggested to install the Subscribe to Comments Reloaded plugin. Once the user will receive comment feedback it will automatically send them email notifications.
This could be a method for improving your site’s client experience since knowing what number of pages with search items were found might be valuable to visitors. On account of the accompanying line of code in your search.php record, you will have the option to demonstrate what number of things are identified with that search:
<h2 class=”pagetitle”>Search Result for <?php /* Search Count */ $allserach = &new WP_Query (“s=$s&showposts=-1”); $key = ks29so_specialchars($s, 1); $count = $allsearch->post_count; _e(‘ ‘); _e(‘<span class=”search-terms”>’); echo $key; _e(‘</span>’); _e(‘-‘); echo $count . ‘ ‘; _e(‘articles’); ks29so_reset_query(); ?></h2>
This way an uninformative and general title such as “Search Results” becomes a respected one by as long as the precise number of articles linked to the search.
Delay yourself a little while when you publish the post to RSS and give yourself time to double-check your live posts. Have you at any point published a post and afterwards recognized there was a tremendous mistake in the first passage? It’s simple enough to fix the blunder, yet it is too late for all your subscribers – your post has just been published in their RSS feeds. Delay a little to double-check your live posts before publishing to RSS. Add this snippet to your functions.php file:
{code type=php} Function publish_later_on_feed($where) {global $wpdb; if (is_feed() ) { $time_now = gmdate(‘Y-m-d H:i:s’); $time_delay = ‘15’;// integer $time_span = ‘MINUTE’;//MINUTE, HOUR, DAY, WEEK, MONTH, YEAR $where = “AND TIMESTAMPDIFF ($device, $wpdb->posts.post_date_gmt, ‘$time_now’)> $time_delay”; } Return $where; } Add_filter(‘posts_where’, ‘publish_later_on_feed’);
Change the value of $time_delay
to whatever length of time suits you.
Google Analytics allows developers to find out all the information about user behavior. In case you don’t want to get troubled with coding, then Monster Insights is the best plugin that can set up Google Analytics to the webpage. Complete the process faster this way. Find the <body>
tag and insert this Google analytic code inside header.php file. This is super easy and a vital WordPress tip.
By illuminating the total number of registered users a lot of WordPress developers want to demonstrate website authority. You can simply download Simple Blog Stats plugin and this tool will show you the overall number of posts, comments, drafts and many other features.
The websites prepared on WordPress display images on the top of each other. It usually doesn’t seem nice. You can change the format to grid layout if you desire to change it. Also, you can do it manually or use plugins such as Envira Gallery.
It is always recommended to log out from the public networks after usage as it can be dangerous. However, if you continuously use the same network, then permit it to remember your login data like this:
add_filter (‘auth_cookie_expiration’, ‘stay_logged_in_for_1_year’); function stay_logged_in_for_1_year( $expire ) { return 31556926; // 1 year in seconds }
WordPress turns normal quotes to smart codes. This could break the code snippet you are about to publish. By inserting the following code snippet to your functions.php file, you can put out of action this feature:
remove_filter (‘the_content’, ‘wptexturize’);
Being a developer you love to see the webpage background colour change randomly day after day. By using the plugin called Fabulous Background Colors or with changing functions.php code you can do so.
You can make your own and remarkable design in case you need more than the default WordPress navigation menu. You need to enter the function wpb_custom_new_menu
, for doing this and after that choose ‘My Custom Menu’ in the appearance menu.
Maximize the SEO potential of your posts and to progress your search rankings, you can add categories to content links. For this reason, you should go to settings-permalinks, choose the custom structure and write /%category%/%postname%/
beside.
If you want to have a deeper control over the results users can get, you might need a way not to show specific categories within the results page. Open your functions.php file and add:
Function SearchFilter($query) { If ( $query->is_search&& ! is_admin() ) { $query->set(‘cat’, ‘8,15’); } Return $query; } Add_filter(‘pre_get_posts’, SearchFilter’);
We should begin with one about marking. In the event that you at any point needed to change WordPress logo on the login page with yours (or a clients’), that is the code you will require. Paste the following in your functions.php file:
Function my_custom_login_logo() { Echo ‘<style type=”text/css”> H1 a { background-image: url(‘.get_bloginfo(‘template_directory’). ‘/images/custom-login-logo.gif) !improtant; } </style>’; } Add_action(‘login_head’, ‘my_custom_login_logo’);
By putting together the subsequent code to your functions file, you can augment a customized CSS file with the name ‘custom.css’ to your WordPress theme. Locate the new CSS file on the same directory that of main CSS file.
function custom_style_sheet( ) {ks29so_enqueuq_style( ‘custom-styling’, get_stylesheet_directory_uri( ). ‘/custom.css’); } add_action (‘ks29so_enqueue_scripts’, ‘custom_style_sheet’);
You can add the code given below to your CSS file after creating a child theme.
/* Theme Name: Child Theme Name Template: parenttheme */ @import url(“. ./parenttheme/style.css”);
While activating a huge plugin, you found an error saying that memory exhausted, then complement the following line of code to your wp-config.php file.
define(‘WP_MEMORY_LIMIT’, ‘64M’);
This code will enhance the memory limit to 64M however you can modify the value to whatever your hosting server is able to upkeep.
Make new custom field entitled sidebar, when writing a post. By means of custom field show made-to-order sidebar content for separate posts. Find the subsequent line of code in your single.php, index.php and page.php file.
<?phpget_sidebar ( ); ?> Substitute it with the succeeding code snippet. <? $sidebar = get_post_meta ($post -> ID, “sidebar”, true); get_sidebar ($sidebar); ?>
Wikipedia defines a programming hack as “an inelegant but effective solution to a computing problem”. We are calling it hacks since we are changing the WP documents. Make your general WordPress experience more beneficial with these simple tips. It does not involve immense instructional exercises. The incredible thing about WordPress is that its ubiquity has prompted a lot of tips and instructional exercises accessible which can tell you the best way to do bunch of stuff, little WordPress stunts which push your site to its most extreme potential. With the popularity of WordPress, large amount of tips and tricks tutorials is available to show how to do lots of stuff. Push your website to its maximum potential with the help of these small WordPress tricks.
The real dare for the programmers is to become the masters of WordPress design as it is hard to find a website that doesn’t run on this system. Keeping WordPress secure is not hard, however cleaning up hacks is hard. Implementing these 20+ WordPress hacks will decrease the risk of your website being hacked. Remembering these basic concepts when generating or working on your WordPress website can aid you to prevent WordPress hacks from occurring.
Drupal is another best web CMS tool. Utilize Drupal services that will assist you to build the right content management strategy for your website development.
Great Article Ashley. Thanks for sharing such useful information.