WordPress
-
Search multiple tags with WordPress
There’s plenty of backend solutions and plugins available – but if you just want to keep it simple; type your known tags into the URL bar with a “+” joining them (don’t forget the “/tag/” part): example.com/tag/cats+dogs/
-
WordPress: excluding a category from author.php
(‘cos it took me more than a couple of minutes to find a relevant answer)
-
Exclude child categories from category listing in WordPress
Add this before the Loop in archive.php: Found on wordpress.org/support
-
On migrating and merging WordPress (local to remote)
Few things to note on the process of bringing this site to life…
-
Hard coding your site URL in WordPress
I discovered this handy feature when troubleshooting a login problem for a client of mine. If you swap your WP database between your local development and production server at all regularly — and don’t fancy editing your site URL and WordPress URL in the wp-options table each time (either directly or via the WP admin…
-
Nice WordPress article in .Net
Nice article about WordPress in my favourite web design and develpment magazine (issue 217 of .NET). Usual stuff but well written without either speeding or jabbering. There’s a nice overview of Custom Menus, Multisite, Custom Post Formats, Custom Post types and Custom Taxonomies. WP Custom Heaven One thing I’d never heard of before was the new…
-
Getting a page ID in WordPress
Q. Want to get something in your theme to work with data from a particular page or post – but don’t know for sure what that post’s ID is? A. Try this in your functions.php file: …then you can then pass a variable about in your theme’s templates.
-
Passing a variable about in a WordPress theme
I’m used to using php variables set in included file being used in another included file if all are included in the same document. This doesn’t work in WordPress theme parts. It’s easy to overcome though… you just need to recall the variable first… somewhere in functions.php Now i can do this somewhere in header.php
-
Multiple WordPress excerpt lengths
Q. Got a theme that needs two different excerpt lengths? A. Found here: set the standard, longer excerpt as normal in the functions.php file and the override locally using this code:
-
Avoid WordPress Trackbacks within your own site
So you’re doing the right thing and crafting internal links within your site to give the thing meaning and usefulness (or SEO)… but WordPress then adds superfluous trackbacks in the comments of the pages/posts your linking to… There are plugins to prevent this (of course!) but there’s no need for them as it’s very simple…
-
Rotating Twitter Tweet feed in WordPress
Again, this is for one my current projects: my mate Phil’s digital DJ tips site… OK – so there’s loads of plugin’s out there that do this kind of thing but I’m not after anything fancy (or bloated), I’m happy to code this into the theme files with a bit of PHP and well –…
-
WordPress jQuery conflict solved
After several hours of thinking I’m being a idiot (happens occasionally) I discovered that sometimes you’ll need to call before any jQuery scripts (or concatenated scripts in my case). It’s been hours and I couldn’t figure out why none of the Carousel scripts I was trying today wanted to work – while all other scripts…
-
WordPress loop with x big posts in one column then a grid of y smaller posts in z columns
Here’s how I managed to get this loop to work for the custom WordPress theme I whacked off for my friend and erstwhile colleague Phil Morse AKA Digital DJ Tips The challenge I set myself was to get the loop to display posts in two formats: first a certain number of posts with large excerpts and…
-
Long/short headings (or title tags) using WordPress Custom Fields
[ This post is now largely if not entirely redundant now thanks to WordPress 3 menu options ] Problem: WP titles are too long to fit in your navigation. Solution: Make the title short enough to fit in the navigation and then add a Custom Field into your post (in the example bellow it is…
-
How to show just sticky posts in a WordPress template
Want to just show just your sticky posts in a WordPress template? This guide tells you how (and much more) – but you’re hacking a theme and are stuck when it says “add this code before the loop” – well the loop is the bit that starts if (have_posts()). In the below example I’m hacking…
-
Using WordPress.com stats and Google Analytics on a WordPress instal
Wondering which you should use? Use both. (As recommended by Mr WordPress himself…) The WordPress.com Stats WordPress plugin provides all the basic daily dose of stats you need – and all easily accessible from the WordPress Dashboard. Google Analytics gives you that extra oompf when you need it and will of course tie in with…
-
WordPress 403 import error and how to solve it
[or Check Your WordPress.com Privacy Settings] Yesterday I was being an eedgit. For the life of me couldn’t figure out why I was getting a 403 error “Remote file returned error response 403 Forbidden”. I was trying, and failing, to get image attachments to import from a WordPress.com XML export file into a self hosted…
-
How’s your php.ini?
Mine’s just fine now. When trying to upload a photo via WordPress’ interface I used to get this error: Fatal error: Allowed memory size of 8388608 bytes exhausted Couldn’t find a quick fix and worked around it using Flickr until today. Recently MediaTemple sent notification of a default change to all their users’ environments. In…