Now that you have a decent understanding of meta data, how to save it and display it, let’s review some good tools for helping us manage the display and saving of our meta data.read more
Now that we’ve covered the fundamentals of what post meta is and how to use the functions to save and retrieve it, let’s take that information and make something useful. In this article, we’ll cover adding a metabox to the WordPress post editor screen, adding an input to that metabox for entering the post subtitle, and then saving it when the user saves/updates the post. We won’t go into depth in this post
about the many other functions used here, but you can find a wealth of information about them on the Codex.
this months featured snippets
Adding this snippet to the functions.php of your wordpress theme will check if an option was updated by a user. If so, it will save it back to the default option you’ve set. Should work with almost any site option. (inspect element on input field and input’s “id” should be the “name” you need.)read more
Add the first snippet to the functions.php of your wordpress theme then add the second snippet within the body tag of your wordpress header.php template.
<body <? body_class(); ?>>
This snippet will add class based on the users operating system “windows, mac, linux” and also the browser including iphone and if Internet explorer the specific version.
Add the first snippet into the functions.php and the second snippet into one of your wordpress template files. This snippet will allow you to return a page ID by the page name. Don’t forget to change PAGE_NAME to the name of the page you would like to return the ID of.read more