Info & Stuff...

Post

Common htaccess redirects

List of some basic htaccess redirect rules

Read more >>

Snippet

WordPress conditional for custom post type

A simple conditional if statement for custom post types i.e. display different content if it’s the defined custom post type. Just replace custom-post-type with the ID you have given your custom post type in register_post_type within your theme’s functions.php (usually) and then echo the content you want blah blah.

Read more >>

Post

Apache 2 Basic Terminal Commands

Debian & Apache 2 Start/Stop/Status sudo service apache2 start sudo service apache2 stop sudo service apache2 status New vhost sites sudo a2ensite local.newsite.com or sudo a2ensite local.newsite.com.conf add a new local site – afterwards run sudo service apache2 reload sudo service apache2 reload reload apache CentOS Start/Stop/Status sudo /etc/init.d/httpd start sudo /etc/init.d/httpd stop sudo /etc/init.d/httpd restart sudo /etc/init.d/httpd status

Read more >>

Post

Enter and display code snippets in WordPress custom fields

If you use a WordPress custom field to display code snippets like I do on this site, then you will notice that if you enter the full code with <\?php e.g. <?php echo get_post_meta($post-&amp;gt;ID, ‘custom-post-name’, true); ?> It will not display as you need to tell your template to escape the special characters. To do […]

Read more >>

Snippet

WordPress simple list of the current posts tags

Simple function to print a list of tags which the current post is tagged with e.g.

Read more >>

Snippet

WordPress simple get post meta

This function returns the values of the custom fields with the specified key from the specified post. This is the simplest method of simply echoing out the value of a WordPress custom field on a post or custom post. Just replace custom-field-name with the name of the desired custom field you want to echo out.

Read more >>

Post

Redirect WordPress attachment urls to the file url

Been having clients upload PDF docs to WordPress in the usual way, WordPress then creates a post url for that file upload – no worries. Trouble is many clients are then using this as the link to the document and then wondering why when they click the link they are just taken to another page […]

Read more >>

1 2 3