Enhance Your WordPress Theme with 5 Simple and Easy to Follow Tips

Hi, It’s time to New Post..

Making slight changes in your WordPress theme can enhance it considerably. Here we are sharing five simple and very easy to follow tips which can play a significant role in improving your WordPress theme.

Customizing Login page

Although it is not possible to add a login page, you can definitely customize the landing page which is already present. Whether you want to make small changes in the logo design or give an entirely different look to the layout, login_enqueue_scripts action is the best place to begin. It allows you to either include a single CSS piece or link a whole CSS file. Besides, it makes it possible to queue up a JavaScript which you would like to use.

At this step you should be careful while making use of only a few selectors which can assist you in creating a base style. The steps have been explained in detail in WordPress codex, however the information mentioned here is enough to give you a good headstart.

Add post title to blog title

Many SEO plug-ins can be seen making use of this and sometimes we wonder why this is not set as the WordPress behavior by default. Here you will be overriding the wp_title behavior. By making it default our aim is to show it on the actual post. As this condition is fulfilled, you just have to grab the existing post title, prep-ending it to blog title. With prending we assure that it is visible in browsers title.

Ensure you have updated rewrite rules

This is one factor which catches many people off guard, especially when they work with the custom post types. In case, rewrite rules have not been updated while you are updating the theme, then these might not render at all. This problem will not be highlighted and you will have to rectify it in a manual way, by going into Admin>Permalinks and then click on Save Changes. This can be automated by after_switch_theme action and later calling flush_rewrite_rules.

Redirect a search in case of a single result

This is although an effective option, however not everyone can make the right use of it. Many people consider that in case of only result, it is what they might be looking for. It can be done with the help of the template_redirect action. For doing this all that needs to be done is to ensure that it’s a search, while there is only a single result for global query.

Customize search to any Check post title

This step is aimed at lowering the noise in search results. It is programmed to display both post title, as well as the content, by default. It means that if specific words are not mentioned then the user will have to scout through plenty of useless results. Override posts_search filter and it will offer an alternating SQL query. As this feature is not documented, thus you will have to spend time on maintaining it, especially if some changes are brought in by WordPress in future. For doing this, you need to catch a part of gateposts option in query.php. It can be then used to overrite default SQL search, while ignoring the previous content.

This can also be customized further and turned into an option for including or excluding the post content. It can be used as a global setting for theme by using get_option&set_option. Besides, you can also add a check box or radio for your search form, to check the presence of parameter in query string. Another good idea might be to add Meta tables, such as wp_postmeta.

Making right use of such options can help to enhance your theme and make it appear more polished to give your users a complete experience.

1852 1 Views Today