WordPress Functions That Make Blogging Efficient

If you want to modify the Wordpress theme, you will need to offer customization in the function.php file within the theme. Within this file, all the relevant data related to the theme is present, and accepts unlimited number of modifications. You can get this file within the themes folder of your Wordpress website.

If you want to customize your blog's behavior, then you will need to customize this file. When you customize this theme file, you get to customize a lot of options within the blog. You have better control on the customizations when you opt for creating changes within the functions.php file.

Using Shortcodes Shortcodes were basically introduced in order to make customizing files and folders within a theme easy and convenient. Let's add a function to the functions.php file in your theme folder and give it a name. you can later call this function using the code add_shortcode, and using the assigned name call the shortcode within the function

// Creates our function
function ExampleShortcode(){
    Code we want to process here…
// Registers our function with the shortcode. First parameter is the shortcode name, the second is our function name.

Using [example] you can easily process this function in a post or page. Now that you know how to use shortcodes, let's see which functions help boost the functionality of your blog.

Adding Links to your Posts

It is a habit of a great blogger to link other articles related to the current post. What happens in most cases is that you tend to share the link of the other article within the post. As your post base increases, you keep increasing the number of links within a particular post.

Let's say, while you are at it, the address or directory structure within the blog undergoes a change. This simply means, you will need to change the links within the post manually. Now, that can be a tad bit difficult, changing everything manually. Instead of making the links static, try creating dynamic links using a simple function get_bloginfo('wpurl')

You will need a shortcode to perform this customization

function BlogAddress(){
    return get_bloginfo('wpurl');

With this URL shortcode added to the links within the blog post, you will see that the link remains despite changes in the directory. The settings within the shortcode will be modified within the settings whenever the directory structure or the blog address changes. With this shortcode, you are saved the efforts of changing all the links within a blog manually, every time a small change occurs in the blog.

Immobilize Modification of Source Content

Let's say you wrote a post in word, and then pasted it to your blog. What happens in this case? Your blog takes on a strange behavior and starts add the </br> towards the end of every line break. A break is added to every line, whether it ends in a paragraph format or not. This can cause a lot of formatting errors within the post, making it look bad.

There are several methods that you can use to change the behavior of your blog, but how about disabling this thing for good? Add the following code to your functions.php file and you can make sure the source code modification is disabled

remove_filter ('the_content', 'wpautop');

this filter that is being added disables both <p> as well as </br> tags that offer line breaks. This code will modify the posts and pages that are shown to the users. If you want to change the post excerpts as well then add the following code

remove_filter ('the_excerpt', 'wpautop');

With this code added, all the pages within the blog will follow the code that you have added. Since you have added this filter, you will need to add the breaks yourself. So, you will need to first plan where all you need the break and add them accordingly. In case you are new to Wordpress, you may not want to add this filter, as you are never sure when and where to add the breaks.

Render the Fancy Characters Inoperative

Sometimes Wordpress adds quotes, dashes and other special characters within your blog. This can be quite irritating, especially when you don't want them in your blog post. When you add the HTMKL block code to your post or page, you will see that the wptexturize function has a habit of replacing single and double quotes with fancy characters. In case, you have just pasted the block code from someplace else, you run the risk of including the fancy characters within your blog post. While replacing the regular blocks with some fancy characters does make your blog look good, adding it everywhere can ruin the appearance. Also, you as the author should decide when the blog should include the fancy characters, and when it should refrain from doing so.

You can easily disable the fancy characters from the functions.php file in your theme folder. Add the following code to your functions.php file

remove_filter ('the_title', 'wptexturize');

To remove the fancy characters from wthin the content of a particular post

remove_filter ('the_title', 'wptexturize');

If you want to remove the fancy characters from within all the posts

remove_filter ('single_post_title', 'wptexturize');
remove_filter ('bloginfo', 'wptexturize');
remove_filter ('wp_title', 'wptexturize');  
remove_filter ('category_description', 'wptexturize');
remove_filter ('list_cats', 'wptexturize');
remove_filter ('comment_author', 'wptexturize');
remove_filter ('comment_text', 'wptexturize');
remove_filter ('the_title', 'wptexturize');
remove_filter ('the_content', 'wptexturize');
remove_filter ('the_excerpt', 'wptexturize');

Remember, you will need to choose from where and how you want to remove the filter. Don't disable the code from the HTML code in case you are not going to share the same with your visitors.


By adding these functions, you are disabling unnecessary characters and functionalities from affecting the appearance of your blog. You want your blog to have an interactive interface and an appealing effect on the users. Not only do these functions help make your blog efficient, but also keep the users engaged.

Note: Don't forget to take a backup of your existing functions.php file before adding customized codes to it.

Deepa is a passionate blogger associated with Semaphore Software. A leading Offshore WordPress development company. She loves sharing information regarding WordPress tips & tricks. If you are looking for Hire WordPress Programmers then just get in touch with her.

Deepa Ranganathan
  • wordpress
  • blogging
  • wordpress theme
By Deepa Ranganathan On 18 May, 15  Viewed: 271

Other blogs you may like

How to Create an Embeddable Content Plug-in?

Wordpress is a popular platform among content managers as it allows you to share the content with ease. Owing to the numerous functionalities added using plug-in, Wordpress is a convenient development and delivery platform. There are many things that you may want to share using Wordpress, like a... By Deepa Ranganathan   On 26 May 2015  Viewed: 243

Integrate Bootstrap Navbar to Speed-up Wordpress Theme Development

There are many instances when you want to speed-up the theme development process, and look out for ways to do it. One of the easiest methods to speed-up theme development is including bootstrap components to your wordpress theme. Here you will learn how to integrate bootstrap navbar in your... By Deepa Ranganathan   On 20 May 2015  Viewed: 288

How to Add Custom Icons to Your Navigation Menu?

It's always good to make your designs user friendly! When your design is intuitive, it guides your user towards the right path all the while. Navigation menus are one of the most intuitive areas of your design. You need to make sure the menus talk for themselves. Adding custom icons to your... By Deepa Ranganathan   On 14 May 2015  Viewed: 206

Adding Twitter Cards to Your Wordpress Website

In the past, posting links to your Twitter meant your user needed to click on the link to know more about it. It never showed a synopsis. But, things have changed with Twitter cards. You can attach the title, and a brief preview of the content along with the link. This is almost similar to pasting... By Deepa Ranganathan   On 12 May 2015  Viewed: 1,223

Customize The Admin Post List in Wordpress Website

What do you see when you click on Admin post list in your Wordpress website? A list of all the posts created by you is displayed with their titles and dates. But, that's about it which is displayed! You won't be able to see any other details related to your post. So, if you want to display some... By Deepa Ranganathan   On 08 May 2015  Viewed: 444