Auto refresh WordPress pages and post

Auto refresh WordPress pages and post

WordPress posts and pages can be automatically refreshed using some tweaks in header of the website. Auto refresh functionality can be used in many ways depending upon needs.It can be used in landing pages to redirect to a particular page or posts after a certain interval of time. It can be used in other situations.for example, if the website is moved from root directory to a new directory and want the users to go to new website through root directory then simply create a page in root directory and write…

Read More

How to add Custom CSS in WordPress

How to add Custom CSS in WordPress

There are different methods for adding custom CSS to your WordPress site. Custom CSS can be added for modify frond-end of your website or modify back-end(admin area) of your website. Modifying website front look is most common. Adding CSS to modify website front-end Add following line of code in functions.php of your theme to modify CSS in front-end of website. </p> <p>add_action(‘wp_head’,’custom_css’);</p> <p>function custom_css() {</p> <p> $output=”<style> .entry-content { background-color : #f1f1f1; } </style>”;</p> <p> echo $output;</p> <p>}<br /> 0 1 2 3 4 5 6 7 8 9 10…

Read More

How to create a custom Shortcode in WordPress

How to create a custom Shortcode in WordPress

Shortcode in WordPress are text macros which are used in content area of a Page or Post and May be Widgets. Shortcodes are created by using a collections of functions. You will learn about shortcode and How to create a custom shortcode as you proceed. What is a Shortcode? Shortcode are text macros or shorthand tags, which can be used in post or pages to display some codes or some custom texts. syntax : </p> <p>[myshortcode]<br /> 0 1 2 [myshortcode] Shortcode can be of two types: Self closing and…

Read More

How to create a Widget Area in WordPress theme

How to create a Widget Area in WordPress theme

Widget Area is a part of a WordPress theme structure where Widgets can be added.Widget area is normally in right side of main content area or in left side of it.It can be created in header area of website,in footer area of website or in the middle of posts.Almost anywhere you want. Widget areas also referred as Sidebars. To add a Widget Go to Appearance > Widgets and Drag a Widget to a Widget Area.Here you can add available Widgets. Most new themes are widgetized now.check your theme Widgets Section…

Read More

How to create a Widget in WordPress 4.4

How to create a Widget in WordPress 4.4

WordPress widgets are content blocks that can be used to add different type of content & features(for example, list of latest posts, a slider, a interactive map, a contact form etc) in the theme. Widget are used to control structure of theme by creating different layouts based on widget areas. Widgets can be added in pre-defined widget areas in a theme. A widget can be added/removed from Theme customizer or Appearance => Widgets as shown below. Adding widgets in Theme customizer   Adding Widget in Appearance => Widget : You…

Read More

How to make menu links open in a new tab/window

How to make menu links open in a new tab/window

By default a menu link in WordPress Menus opens in same window.What if you want a page ,category or other post type link in a menus open is new window/tab ? It is very easy to set a hyperlink to open in new tab/window in HTML. </p> <p><a href=”http://wpgyan.com” target=”_blank”>Link Text</a><br /> 0 1 2 <a href=“http://wpgyan.com” target=“_blank”>Link Text</a> In WordPress by applying some conditional PHP codes in menu it can be set to open to new window/tab. But In this post I am going to show you how to…

Read More

How to redirect to another page in WordPress

How to redirect to another page in WordPress

A page can be redirected to a new page or URL. There are different methods to achieve this. In this blog post we will deal with all these methods in details. Use of these methods depends upon different  use cases. Sometimes HTML redirect work perfectly, in some cases JavaScript or PHP. There is a WordPress function which can also be used and I think it is best to use WordPress function. Here are different methods for redirect   HTML Method In this method we will use meta redirect. Add following…

Read More

How to reset WordPress password at Localhost

How to reset WordPress password at Localhost

In this article I will explain steps to  Recover WordPress Admin password at localhost via phpMyAdmin Interface. Resetting password at live server of WordPress Self hosted blogs/websites are easy. What if you forget password of a localhost installation? To reset password at localhost some manual work needed to be done.  On localhost installations WordPress Reset password function don’t send a reset e-mail to your e-mail.Since most default localhost server install has not configured to send a e-mail.   So, How to deal with it? Follow these steps to recover Lost…

Read More

How to run multiple commands in Linux SSH

How to run multiple commands in Linux SSH

To run multiple commands in Linux SSH, all we need a to write a Bash shell script. The shell script execute the commands based on the order in which commands have been written. You can have loops, if else statements etc like any other programming.  For this post I am restricting myself to getting started with a shell script and run few commands. Here are steps to create a simple Bash shell script. Create an empty file using vim. </p> <p>vim test.sh<br /> 0 1 2 vim test.sh Enter Bash…

Read More