Category Archives: Wordpress

How to create “Shortcode” for a custom field

First of all you need to add below code to the function.php of your WordPress theme.


add_shortcode('field', 'shortcode_field');
        function shortcode_field($atts){
        extract(shortcode_atts(array(
        'post_id' => NULL,
        ), $atts));
      	if(!isset($atts[0])) return;
        $field = esc_attr($atts[0]);
        global $post;
        $post_id = (NULL === $post_id) ? $post->ID : $post_id;
        return get_post_meta($post_id, $field, true);
}

Now use the below Shortcode inside pages or posts to display custom field value.
Make sure the ID of the Shortcode field below should be same as the name of the custom field.

[field “my-block”]

Best WordPress Plugins That Every Website Should Have

Hello Guys!!!
As you all know. Now a days, WordPress is the most popular CMS to build any kind of websites.
So you should know which plugins are the most popular for your website.

Below is the list of all the free plugins that you should install while installing WordPress. And these plugins can be make your site more interactive from user perspective.

  • WP-DB-Backup
    You can take backup of your WordPress database.
  • W3 Total Cache
    This plugin allows you easily to backup your core WordPress database tables.
  • Scroll Back to Top
    This plugin is very helpful from a user perspective. If your web page is long in terms of height. You can install this plugin.
  • All In One SEO Pack
    This is a very good plugin for SEO. Easy to use.
  • Google XML Sitemaps
    You can install this plugin to create dynamic XML sitemap. Which helps in SEO.
  • PHP Text Widget
    With the help of this plugin you can run your PHP code inside WordPress widgets & page editor.
  • Display Widgets
    If you want to display widgets on specified pages. Or if you want to hide some widgets on specified pages. You can use this plugin.
  • Contact Form 7
    This plugin creates web forms on your website. It’s very popular & easy to use.
  • Contact Form Submissions
    This plugin saves submitted form data to the database. Also you can see form entries of all the web forms in the backend.
  • HTML Widget Titles
    This plugin allows HTML tags in widgets title field. Wich is very helpful for the develpers.
  • Sitemap
    If you want to show a dynamic sitemap on your website. You can use this plugin.
    This plugin has some features. Which is very useful.
  • Responsive Menu
    On mobile or responsive screens, this plugin convert WordPress navigation into a mobile freindly navigation.
  • myStickymenu
    If you want the navigation to stay frozen at the top of the screen. You should install this plugin.
  • Search Exclude
    If your site has some dummy content pages and you don’t want to show them in WordPress search results on your site. You can simply hide them with the help of this plugin.