开发者 | paulperkins |
---|---|
更新时间 | 2015年9月12日 17:58 |
PHP版本: | 3.1 及以上 |
WordPress版本: | 4.1 |
版权: | GPLv2 or later |
/wp-content/plugins/
directory. We'd recommend bimbler-exclude-posts
.bimbler-exclude-posts.php
and class-bimbler-exclude-posts.php
to the /wp-content/plugins/bimbler-exclude-posts
directoryOpen class-bimbler-exclude-posts.php using your favourite editor (or in the plugin editor within WordPress) and
examine the exclude_category
method. Here you'll find $query->set(...
. The comma-separated list are the
post categories (prefixed with '-' to imply 'remove') which will not be displayed.
To determine which categories are suitable for you, navigate to the Posts -> Categories menu within the
WordPress GUI and hover your mouse over each of the categories listed. The URL displayed in your browser's
status bar will contain something along the lines of yourblog.com/wp-admin/edit-tags.php?...tag_id=nnn...
.
'nnn' is the ID you're interested in.
Amend the list to the categories you'd like to exclude and save the file. The post list on the main page of
your blog should now no longer show posts which have the selected categories set.
The Bimblers is a cycling group in Brisbane. I decided I'd use WordPress to create a website for the group, and developed a range of plugins to implement the functionality I needed. I take the philosophy of creating simple, specific plugins to address a particular issue, rather than implementing an ever-convoluting code-base. Some of the plugins are generic, and have been implemented over and over by others, but I wanted to create clean, standalone plugins rather than re-using and adapting others wherever possible. This decision was largely to aid in learning how to write WordPress plugins other than any other reason.
Please have a look at http://bimblers.com/plugins/ to see if anything else is of use to you.