Ultimate Web Tips

your Wordpress, jQuery, PHP, MySQL, Linux and CSS guide to a successful website
Read more:
Posts Tagged ‘Wordpress’

A 404 Not Found is generated when a user trying to access a page that doesn’t exists or if a user finds an old page that still is indexed on search engines (broken or dead link). So instead of displaying a 404 page or message you can redirect with a 301 moved permanently to homepage.

Thickbox is as jQuery plugin that WordPress use as it’s main popup window or modal view. It’s already built-in in WordPress so why not use that in front end. No need to download or import any extra files.

WordPress has had the ability since a long time ago to add custom fields to posts. Also called as meta-data. It’s also possible to add these values to your table list and make them sortable.

“WP Easy Backup” is a WordPress plugin that will create a database dump and zip all your media, theme and plugin files.

November 8th, 2011

Remove slug from custom post type

60 Comments, Wordpress, by Joakim Ling.

In WordPress 2.9 custom post type was introduced, that opened a new world for many WordPress developers. I’ve come across a painful issue when it comes to removing the slug and not destroying the rewrite rules for other post types. This only concerns those who are using %postname% as permalink structure and want to add a custom post type so that the urls for them are in the same way as normal posts and pages: http://siteurl/%custom_post_type_title%/.

I was confused for a good hour with this problem, scratching my head. My “Page template” drop down had disappeared. Before start digging to deep in WordPress I made sure the files were still in my theme folder, checked that head comments that define a template not gone missing or had been messed up, even checked file permissions so that the files are readable and that the theme is still active, still no drop down.

First we need to find the ID on the given post. Easy done with get_page_by_title(). If more then one post has the same title the post with smallest ID will be returned.

Having /category/ in your URL isn’t very handy for most people, especially for those wanting to use WordPress as a non-blog CMS. WordPress shows category views by default with /category/ as the base. http://www.domain.com/category/categoryname/

If you are new to creating themes in WordPress it can be a bit tricky to get the relevant image path.

WordPress uses a special class for various tree-like structures called a Walker. It’s used for viewing categories, pages, comments. The default class is called Walker_Category and you can extend that with your own walker to customize the output as you would like it.