WordPress API: get post-tag by slug.

WordPress
This article shows how to get a post-tag by slug. To get the tag object for a given tag slug, we will use the WordPress get_term_by() method. Usage [crayon-5f0a801d22f04212349767/] Parameters 'slug'String that indicates that we want to search the field 'slug'. $slugString that specifies the slug of the term we are looking for. 'post_tag'String that indicates that we are looking for a 'post_tag' term. Return Values (object) Tag data object.(boolean) false if not found Example [crayon-5f0a801d22f0e754661800/]
Read More

WordPress API: get category by slug.

WordPress
This article shows how to get the category by slug. Usage [crayon-5f0a801d2325d497483826/] Parameters $slug(string) (required) The category slug.Default: None Return Values (object) Category data object.(boolean) false if not found Example [crayon-5f0a801d23266082131632/]
Read More

How to add a widget area to the bottom of every post.

Web, WordPress
This tutorial shows how to add a widget area to the bottom of every post. On many sites you will find a standard text at the bottom of all WordPress posts. This is a great place to remind your readers about something you want them to do, a special promotion you are running, etc. Next we will show you how to add a widget area to the bottom of every post. Once you have the widget area in place, you can add any desired content to that area using the admin pages of WordPress. 1) Register the widget First you need to tell WordPress you want a new widget to be available. To do so, you need to add the following to your functions.php file, which is located in the…
Read More

Making the content area of the WordPress twenty-fourteen template wider.

Web, WordPress
This tutorial shows you how to make the content area of the WordPress twenty-fourteen template wider in 4 easy steps. Why should I do this? The default content with of 474 pixels is rather small and content is wrapped quickly. This may reduce the reading quality of your content. To fix this issue you could simple modify the style.css in the /wp-content/themes/twentyfourteen folder, but a better way is to create a child template and specify the style changes in there: 1. Create a child folder Go to the /wp-content/themes folder of your WordPress installation and create a new folder. You can call it [main-template-name]-child but that is not required. In this case we will create the folder twentyfourteen-child. 2. Create a file style.css In the newly created folder, create the style.css…
Read More

Making the WordPress twenty-fourteen template centered.

Web, WordPress
This tutorial shows you how to make the WordPress twenty-fourteen template centered in 4 easy steps. You can simple modify the style.css in the /wp-content/themes/twentyfourteen folder, but a better way is to create a child template and specify the style changes in there: 1. Create a child folder Go to the /wp-content/themes folder of your WordPress installation and create a new folder. You can call it [main-template-name]-child but that is not required. In this case we will create the folder twentyfourteen-child. 2. Create a file style.css In the newly created folder, create the style.css file and add the following content to it: [crayon-5f0a801d23d44656952108/] The only real important part in this section is the "Template: [name-of-parent-template]" line. You need to reference an existing template here. In order to center the page content we…
Read More