Whilst making some updates to one of my WordPress plugins earlier today, I discovered an small issue when trying to make use of the dbDelta function.
Although it’s advised you avoid creating tables unless absolutely necessary, it seemed like the correct method to store the data used by this particular plugin. Continue reading “WP dbDelta function cannot modify unique keys”
After receiving numerous requests to allow the SubHeading value in my plugin to be searched when carrying out a default search, I turned my attention to finding a method to achieve this in WordPress 2.9.x.
The plugin stores a custom post meta entry for any post or page that requires a subtitle, in order to append this field to the search query I required the use of two actions. Continue reading “Extend WordPress search to include custom post meta”
If you use posts within WordPress to generate content, such as Frequently Asked Questions or Help Guides, it’s quite often the case that you don’t want these to appear on the posts page of your blog.
Instead of having to re-create the whole query, you can append a comma separated list of category ID’s that you want to exclude to the end of the original query and fetch the new data set to be used. Continue reading “WordPress exclude categories from homepage”
Over the past few days I’ve been setting up a small and simple, yet long term project in which I intend to write at least one blog post a day for entire year, starting with the first post on 1st January 2010.
The project preparation started on the 24th December when I registered the domain name yearblog.co.uk (a little dull, but to the point). Once that and the hosting side of things were ready I installed the latest version of WordPress (2.9) and began coming up with a few ideas for simple theme. Continue reading “An attempt to write a blog post a day for a whole year”
The WordPress SubHeading plugin allows you to add sub titles to both your blog posts and pages. Last night it followed in the footsteps of my Page Meta plugin by reaching the 1,000 downloads mark.
Yesterday saw over 100 downloads as a result of numerous modifications and updates, some of which due to mistakes on my behalf which was mildly irritating. The main reason behind all the updates was to cater for numerous feature requests and bugs reported by users of the plugin. Continue reading “WP SubHeading Plugin (1,000 downloads)”
The WordPress Page Meta plugin was initially written as a simple solution for adding meta descriptions to pages on a site I have been working on, as this is not available by default. Today it broke through the 1,000 downloads mark.
The plugin quite quickly evolved into a solution that allowed for keywords as well as descriptions to be added, as well as the ability to set a custom page title. If required the page title can even be defined in your page template, allowing for dynamic pages / templates to have specific titles. Continue reading “WP Page Meta Plugin (1,000 downloads)”
If you have written a WordPress Plug-in, or a highly customised page, and you want to add a custom rewrite rule then this is article is definitely the one for you.
We all know that WordPress is a powerful and pretty impressive blogging platform, and contains many useful features. The problem is finding the features you need / want. Most of the time they are available – somewhere. Continue reading “Extending the WordPress mod_rewrite rules”
Many of the blog posts I write tend to be about web development related topics and will often include a number of code snippets. My current choice of syntax highlighter is WP-Syntax, which supports a wide range of popular languages and has the ability to also include line numbers.
The problem with using this plug-in is that the WordPress WYSIWYG Editor (TinyMCE), will remove any tags and attributes that it believes to be invalid according to it’s configuration. As two of the attributes used by this plug-in are custom attributes (escaped/line) they are removed, causing some unexpected output. Continue reading “Using WP-Syntax and the visual editor”
When listing pages using the_loop(), the latest version of WordPress (2.8.4) does not allow for a “Read more…” link to be appended to a list of pages using the_content() along with the <!–more–> quicktag.
Although it wasn’t immediately obvious to me, read more links can be enabled by over-riding the global $more variable and setting it to false, before looping through the result set, for example: Continue reading “WP – Enable read more links for pages”
When re-designing my blog I wanted to display the first paragraph of each blog post in bold text. A CSS3 selector could have been used, but wouldn’t work in older browsers such as IE6.
Instead I decided to write a very simple function to add a class name to the first paragraph by filtering the content, then setting the styles accordingly in my theme CSS file. Continue reading “WP – Add class name to first paragraph in blog post”