分类: 系统运维
2009-04-29 13:50:05
One of the most interesting features in WordPress is using Custom Fields, which can turn your WordPress blog into a fully customizable CMS website. I use custom fields to create image thumbnail for each post here on Noupe and on Devsnippets as well and display the thumbnails on the home page and the Archive page.
" alt="" />
Duplicate content refers to two or more web pages that have the same, or almost the same, content. We must avoid duplicate content to not get penalized by search engines. But sometimes we need to show two (or more) lists of posts on one page, we usually do this by using (one standard loop and one from a certain category). This is done when you want to feature not only the very latest post written, but also posts from a certain category.
have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?> ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
When i was designing DevSnippets, i wanted the users to easily login through the front page and skip the login page. Many solutions are out there and i found a good one at , i will add the code here just in case we don’t find it in the future.
Of course later i wanted to make it even more easier and prettier to register and login through the front page and skip the login and register pages, so we coded a small widget using Prototype to switch between the login and registration box all on the front page. I will write a tutorial about this very soon.
If you would like to have a menu like the one we have here at noupe, to show certain categories, just add the line of code below and style it as you wish.
The template tag, , displays a list of Categories as links. You can Include or Exclude Categories as you wish, just enter the category id and don’t forget to add the “include” or the “exclude” parameters to manage it.
By default, wp_list_categories() generates nested unordered lists (ul) within a single list item (li) titled “Categories”. You can style that list item with a CSS selector.
Sometimes you want to displays a list of categories in a select (i.e dropdown) box with no submit button. The easiest way to do this is use the template tag.
If you want to display certain posts from a certain category like the one i am using for the news section on Devsnippets.
Having multiple authors on your blog is really fun, we need to have good solutions to have nice custom author pages, show their latest posts, highlight author Comments in WordPress posts, show their avatars and author bio below every post.
By default WordPress will use the author.php then the archive.php file then your index.php file to display the author info. That is, if you do not have an author.php file, WordPress will check for archive.php, and so on.
So, if you want to change the look of your author pages, you need to create an author.php file if it doesn’t exist, by copying archive.php if that file exists, or index.php if it doesn’t.
If you want to show the author’s main website, email contact, and biography, helping readers learn more about the author.
Articles by Author Website: Author Email: Author Bio:
If you want to have that handy little author bio box at the top of the article with an author photo, you can do the following:
When you have multiple authors on your blog, you will need to style the author comments differently, here is how you can do it:
If you want to display your Twitter status on your blog instead of using Twitter-hosted scripts to save loading time.