If you would like to know how to limit the amount of letters for the title of the WordPress post, this article is for you. Such feature is helpful, indeed – sometimes you may not allow a user to print as many symbols as he tries to, it could break the design.
The idea is pretty simple: in functions.php you create the function by name (in my case) ‘the_title_limit’:
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
< ?php query_posts('cat=-22');?>
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 »
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: