Adding Code snippets to the WordPress functions.php file enables you to perform actions and use filters in a way that will improve functionality of your WordPress site which can make your theme more organised and cleaner. Here is a bunch of useful snippets to further enhance your WordPress theme.
Following on from the post Display Your WordPress Recent Posts on a Static Page which was used to display your WordPress posts on a non-WP website on the same server. I have had several people contacting me on how to display WordPress posts on another WordPress blog. This tutorial will show you how to display your posts, associated post thumbnail images and a snippet of the content from one blog to another by fetching the data from your RSS feed using the SimplePie RSS parser which is included in the WordPress installation.
This tutorial shows you how to integrate the WP Single Post Navigation into your theme without using the plugin. I initially attempted to use the plugin and for some reason it didn’t work on my custom child theme based on TwentyEleven so I decided to hard code it into my theme by adding it to my functions.php. I will show you two methods, one to display the default WordPress single post navigation and one to display how to reverse the links for a book like affect.
This tutorial shows you how to display your recent posts on a static web page. So now you ask the question ‘Define Static?’ There are a variety of reasons why you may have static pages. You could, for example, have built a website from scratch and then decided to integrate a blog or news section into it and require to pull some information from the blog to your homepage. There have been several methods on the web including directly accessing the database. This is a simple but elegant solution in which I will show you 2 methods, one of which will be on a page with a .php extension and another will be on a page with a .htm extension. If you want to display your latest posts on an existing WordPress blog please check out the following post.
Update – January 2016 – Please also check the FAQ’s Page that I have set up to go along with this tutorial.
Having updated my theme to make use of the WordPress navigation menus I decided I wanted to have an indicator to display that there is a drop-down menu. This can be done many ways with plugins etc but I wanted to do it without the need for a plugin. So I had a think and came up with this idea which requires very little knowledge to carry out.
Following my previous post how to display twitter posts on your site. I decided to tweak it further by adding a time since function and I have also renamed it WOW Tweet Show. Check my footer for an example. This script has been depreciated in favor of the the new Twitter API. Check out Display your Cached Tweets Using PHP and OAuth
This script has been depreciated in favor of the the new Twitter API. Check out Display your Cached Tweets Using PHP and OAuth