Display list of wordpress pages in two columns
November 28, 2009
Usually in WordPress, the following code is used to call the pages list (you can find it in one of the sidebar files): <?php wp_list_pages(); ?> Normally when the list of pages is displayed in the sidebar or on any part of the theme, it displays in a single column. Through the following hack, you can split your pages list evenly into two or more columns which can save space and not make your pages longer. Now, we will try and split the pages into two columns. Simply paste the following code where you’d like your... [Read the full story]
Get tags related to wordpress category
October 13, 2009
Do you noticed there is no native way to retrieve tags based on the wordpress category. But if you want to be able to get tags related to one (or more) specific category, just insert the following function in your theme’s functions.php. Here is the function you have to paste in your function.php file: function get_category_tags($args) { global $wpdb; $tags = $wpdb->get_results (" SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link FROM wp_posts as p1 LEFT JOIN wp_term_relationships... [Read the full story]
Get all wordpress custom fields from a page or a post
October 10, 2009
Sometimes you may need to get all custom fields from a specific post or page. How can we do that? Just paste the following functions on the functions.php files from your theme. Note: The function have lots of comments so it will help you to understand how it works. function all_my_customs($id = 0){ //if we want to run this function on a page of our choosing them the next section is skipped. //if not it grabs the ID of the current page and uses it from now on. if ($id == 0) : global $wp_query; ... [Read the full story]
Choose which wordpress sidebar to use
September 26, 2009
Wordpress always have to display the same boring sidebar on each page? What can we do? Don’t worry, just create a few sidebar files, upload it to your wordpress theme directory. Then the code follow will do the rest. open single.php and find the call to the get_sidebar() function: <?php get_sidebar(); ?> Replace it by: <?php $sidebar = get_post_meta($post->ID, "sidebar", true); get_sidebar($sidebar); ?> Now when you’ll write a post, create a custom field name sidebar. As a value, give it the name... [Read the full story]
Hide wordpress login page error feedback
September 25, 2009
Is your blog secure? Normally when you try to login and mess something up, WordPress dishes out a helpful sentence or two either explaining that your username or your password is incorrect. While this is helpful for you and your site’s members, it’s also helpful for anyone trying to do bad things to your site. Here is a quick tip that you can easily implement to prevent displaying useful message to potential wordpress hackers. To remove theses error messages, simply open your functions.php file and paste the... [Read the full story]




















