Category: WordPress Tutorials
-
Separate Logic From Output
Once HTML is defined within a function for output, the HTML will be separated from the logic! In this case the function is defined twice. A function contains only logic and values are returned only as return. The second function will contain HTML, test logic, loops or hooks and outputs values as echo. Ok, the…
-
WordPress constants overview
In the backend of WordPress you don’t have an input field for each possible modification. Some are only available via an action or a filter and for some changes you need to define or change a PHP constant. In this article I have listed all constants which WordPress has by nature (except the deprecated ones).
-
Add Icon to Site Link in the WordPress Admin Bar
Each button in the Admin bar has a self-defining and space-saving icon. But the link to the blog frontend (which is represented as a blog title), has no icon. If you want, you can change it quickly – here is a small solution.
-
Return the Template Name of Current WordPress Page
WordPress save the assignment in the post_meta table and so it is easy to get the template name with the default function to return post meta data – get_post_meta(). The key for the value is _wp_page_template.
-
Remove Inline Style Of WordPress Gallery Shortcode
Today I’ll give you a small tip for the WordPress Gallery. With version 3.1 of WordPress it is possible to replace the inline style of the core, it’s done easily with a Filter-Hook. Use this and include your custom style with the Theme in your frontend; no Plugins, CSS or functions in your Theme for…
-
Advent Calendar – Predefined callback functions for filters
Filters are often used for removing content. For example, if you want to hide the admin bar you can do the following: function hide_admin_bar() { return FALSE; } add_filter( ‘show_admin_bar’ , ‘hide_admin_bar’ ); It’s a bit tedious to define an additional function just to return “FALSE“. Since version 3.0 WordPress provides various functions to shorten…