How Change and Update WordPress URLS in Database When Site is Moved to new Host?

Hello Everyone! After migrating a WordPress site to a new URL either live or to a production or development server, the new URL strings in the mysql database need to be changed and updated in the various mysql database tables. This method just uses the whole mysql database rather than a WordPress export/import from within, and …

How register a custom shortcode for wordpress site?

Hello Friends! If you want to create a own custom shortcode in your wordpress website, then don’t worry just use my code. function my_function( $atts ) {      return “My Name is = {$atts[‘content’]}”; } add_shortcode(‘myname’, ‘my_function’); For register you new shortcode ,just need to add this code in your themes function.php file Your shortcode …

How reterive posts content from a specific category in wordpress website?

Hello Everyone! If you want to display the post lists from a specific category, then don’t worry i am here for you only. just use my code (given below) . For do this you have not require any technical knowledge, just copy and paste my code. <ul>        <?php           //        …

How to check user logged in or not in wordpress?

Hello Everyone! I am come back with a new information. If you are planning to set a different-2 custom message for registered and guest user then use my code given below : <?php if ( is_user_logged_in() )  { //go here when user is logged in //message for registered user     echo ‘Welcome, registered user!’; }  else  { //Go here when user not …

How register/create new custom post type using hooks in wordpress site?

hello everyone If you are planning to create a custom post type then use my code, hope you will enjoy my code. Add this code in your theme function file add_action( ‘init’, ‘create_post_type’ ); function create_post_type() { register_post_type( ‘R_News’, array( ‘labels’ => array( ‘name’ => __( ‘News’ ), ‘singular_name’ => __( ‘News’ ) ), ‘public’ …

How display custom menu navigation on post/page

Hello Everyone! if you are planing to add your custom menu from anywhere in post,then add this code in your theme function file. /* Custom code for call menu any where [menu name=”Site-Map”]*/ function print_menu_shortcode($atts, $content = null) { extract(shortcode_atts(array( ‘name’ => null, ), $atts)); return wp_nav_menu( array( ‘menu’ => $name, ‘echo’ => false ) …

How disable posts auto saving using WordPress hook ?

WordPress have a very useful function that autosaves your posts while you’re typing them in the dashboard. Though, if for some reason you’d like to disable this function, it is very easy to do. Just read on! To disable WordPress autosaving function, simply open your functions.php file and paste the following function: function disableAutoSave(){ wp_deregister_script(‘autosave’); …