Home » WordPress

WordPress

WordPress DIY: Adding Syntax Highlighting to your WordPress Blog Without using an External Plugin

Just as my other articles in WordPress DIY series, this one also focuses on doing everything yourself by writing the code rather than using any external dependencies. There are two popular open source implementations of Syntax Highlighting JavaScript libraries: Google’s Prettify and Alex Gorbatchev’s Syntax Highlighter, and in this article, we will use the former. Writing your own plugin for ...

Read More »

WordPress DIY: Adding Twitter Cards Meta to your blog

Just like my last article, we won’t be focusing on using a third party plugin, but write our own plugin. I’m a minimalist and don’t prefer to use layer-2 solutions for really trivial things that can easily be achieved by writing code. Now, though trivial to implement, the twitter cards support is a very important and useful thing for your ...

Read More »

WordPress DIY: Adding Google Analytics Script to your Blog

Adding a custom script element to your WordPress blog is really straightforward if you know what you are doing and there isn’t any need to install a third-party plugin for this. Now, for something like spam protection (Akismet) or adding contact forms (Contact Form Seven), its quite understandable, but if you take the approach of adding third party plugins for ...

Read More »

Demystifying comments migration from Disqus to WordPress

Some time ago, I had switched from a self-hosted wordpress blog to a statically generated (Jekyll) blog hosted on Github Pages. For a commenting system, Disqus was quite an easy choice at that time since it was zero hassle for us site owners, and Disqus did all the heavy lifting from filtering the comments to storing and displaying them. But as ...

Read More »

10 Essential WordPress Interview Questions

1. Consider the following code snippet. Briefly explain what changes it will achieve, who can and cannot view its effects, and at what URL WordPress will make it available. add_action('admin_menu', 'custom_menu'); function custom_menu(){ add_menu_page('Custom Menu', 'Custom Menu', 'manage_options', 'custom-menu-slug', 'custom_menu_page_display'); } function custom_menu_page_display(){ echo '<h1>Hello World</h1>'; echo '<p>This is a custom page</p>'; } This will add a new menu item labelled ...

Read More »

How to Start a Blog with WordPress (Step by Step Guide for Blog Hosting)

EDITORIAL NOTE: Blogging has surged in popularity in recent years. Companies and individuals are using blogging in order to express their voices and connect with their audience. Most of this is performed on the popular WordPress platform. WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. Features include a plugin architecture and a template ...

Read More »

WordPress get_post_meta Example

Let’s take it as if you’re writing a post in your WordPress website. Being the nice guy he is, WordPress would actually facilitate this for you and why not add some little perks such as you including your favorite song for the moment, or even your mood into your post. This is done through metadata. How exactly? Look below!   ...

Read More »

WordPress functions.php Tutorial

When designing WordPress Themes, you might have wanted to customize a theme by adding your own set of functions to make it come closer to your wants and needs. You are not the only one, and the funny thing is, some of the functions you want to add, are also the ones I (or someone else out there in the ...

Read More »

WordPress get_permalink Example

While working on your WordPress theme or plugin, you might need to get the current posts permalink. Below, you will learn how to do that, and why not also getting another post’s permalink while we’re at it? Let’s find out how!           Definition and Syntax The get_permalink() function makes it possible for you to retrieve the ...

Read More »