QUICK TIP - WordPress tricks – The most useful tricks you should know

0 1,236,174
:4of8
1
2
3
4
5
6
7
8
Most Useful .htaccess Tricks for WordPress | A&H Business Technology
Related posts

Having said that, here is an alternate version of the custom-post-template script:

Placed in your theme’s functions.php file, this alternate script checks all categories for the presence of a custom single template. Any category with a custom single-post template will then have its posts displayed with that template. If a post’s category does not feature a custom template, the default single.php template will be used. Note that this code will use the template for the first listed category of each post. Even so, you should only create custom post templates for categories that will always be mutually exclusive. That is, make sure that your posts aren’t in more than one custom-templated category.

Source: Austin Matzko

Display Performance Statistics for WordPress Pages 

Everyone is familair with the following information:

These statistics are usually seen in the footer area of individual pages and serve as a general indicator of performance. The “queries” refer to the number of times WordPress requested information from the database, while the number of seconds indicates the amount of time required for Apache to generate the page. This information is generated by including the following code in your footer template file (or wherever you would like):

Or, if you don’t like the idea of sharing this information with the entire world, you can limit its display to logged-in administrators only:

Easy breezy beautiful!

Source: Digging into WordPress

Custom Post Thumbnails in Two Steps 

Alright, kids. Time for the ‘ol three-step custom-field tutorial. This time we’re going to implement post thumbnails. You know, representative images for each of your posts that may be displayed anywhere you wish, including outside of the flow of post content, and even outside of the loop. This is a great trick for advanced page layouts. Ready? Sharpen your keystrokes!

Step 1:
Open your write panel and create a key called “thumbnail”. Then, for the value of the “thumbnail” key, enter the URL of the thumbnail image for that particular post. Write the post and then publish it as normal. Wash, rinse, repeat to get a nice collection of posts with thumbnails. Or, go back to exisiting posts and add a thumbnail as we have just described.

Step 2:
Open your theme template file containing the loop and add the following code to the location where you would like the post thumbnail images to appear:

That’s it! Don’t forget to edit the width and height attributes of the <img> element to account for the proper image size.

Source: AH Business Technology

Highlight Author Comments 

Make your author comments look fabulous darling! Newer versions of WordPress come equipped with a specific author class that may be targeted with the CSS of your choice. For older versions of WordPress, however, you will need to add the custom class attribute with a little PHP magic.

TinyURL for this post: https://tinyurl.com/y3vlpp3o

Sorry, The Comment Form Is Temporarily Closed At This Time
:4of8
1
2
3
4
5
6
7
8
4
Next
You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Language:English