About design and nearby

How to Remove Specific Categories from the Loop

Posted: May 19th, 2014 | Author: | Filed under: Development, Tips and Tricks | Tags: , , | No Comments »

Once working with WordPress I wish to exclude all posts in category 22 or (‘Careers’) from showing on the home page. A simple solution like

  1. < ?php query_posts('cat=-22'); ?>

or

  1. < ?php
  2. $exclude = get_cat_ID('careers');
  3. $q = 'cat=-'.$exclude;
  4. query_posts($q); ?>

excludes all posts of category 22 (‘Careers’) from my homepage, but breaks my pagination; when the ‘Newer Entries’ or ‘Older Entries’ buttons are pressed, it simply returns the same posts.
Read the rest of this entry »

How to Show or Exclude Posts from a Single Category only for WordPress

Posted: April 17th, 2014 | Author: | Filed under: Development, Tips and Tricks | Tags: , , | No Comments »

If you have ever wanted to display or hide posts from a specific category only, then it’s pretty easy to do – if you know how.

So you have a WordPress blog with a list of categories. You have specific template (say, the footer section) which is applied to all categories exept “Press Release”. And you need to exclude the posts with certain category (“Press Release”) from this template.

A Small Intro

WordPress has the ‘query_posts’ codex – to alter the main query that WordPress uses to display posts.
If you want to show posts from one specific category (“Press Release”), the code is:

  1. < ?php query_posts('category_name=Press Release'); ?>

Read the rest of this entry »

How to Display a Tag Cloud

Posted: February 11th, 2014 | Author: | Filed under: Development, Tips and Tricks | Tags: , , | No Comments »

To display a tag cloud at the footer section of a WordPress powered website I use the wp_tag_cloud() function:

  1. < ?php wp_tag_cloud( $args ); ?>

How to display WordPress tag cloud

As usual, I started with the HTML version of my tag cloud:
Read the rest of this entry »

How to Display Latest Blog Posts at the Footer

Posted: February 5th, 2014 | Author: | Filed under: Development, Tips and Tricks | Tags: , , | No Comments »

Displaying latest posts in WordPress often helps your visitors to navigate your blog faster.

Once I was trying to display 2 latest posts of all categories with thumbnails in the footer section. The step by step tutorial is below.

1. To enable the support for post thumbnails add

  1. add_theme_support( 'post-thumbnails' );

to your functions.php file (and be sure that you set the featured image for your post at the WordPress admin panel).
Read the rest of this entry »

WordPress Pretty Permalinks on IIS

Posted: January 2nd, 2014 | Author: | Filed under: Development, Tips and Tricks | Tags: , , , , , | No Comments »

Once I setup WordPress blog on the client website. It was a large content management system configured as the main site in IIS with a subfolder running WordPress also. The problem I faced was getting permalinks to work (by default WordPress uses web URLs which have question marks; the ability to create a custom URL structure for permalinks is useful from SEO perspective and this feature works like a charm usually.) Unfortunately, my case was a bit different.

The problem:
If I check any settings for the website in subfolder (exept default) in WordPress Administrator Option tab, I got 500 error.
Read the rest of this entry »

Looking for a Freelance UX & UI designer for your project? I’m ready to jump onboard!

Let's discuss your project now