Archive for the 'General' Category

Category dependent post stylization

Treść tego wpisu jest dostępna również w języku polskim
Most WorPress users still use categories to assign particular post to pre-defined subject. Sometimes we would like to emphase this using different color for post title or background. In other cases we want to skip the date of publication or remove comments template from posts belonging [...]

Custom order of posts on main page

The most common home page on WP powered site contains posts listed in chronological order (from the newest to the oldest one). But sometimes we need different layout. Fortunately WP is quite flexible and allows to create many customized lists of posts.
I’m not going to list all of them since I guess such list would [...]

Tooltips

Tooltip is (according to Wiki)
a common graphical user interface element. It is used in conjunction with a cursor, usually a mouse pointer. The user hovers the cursor over an item, without clicking it, and a small box appears with supplementary information regarding the item being hovered over.
Just like on this image.
Although in Opera browser [...]

Category-x.php file one more time ;)

Treść tego wpisu jest dostępna również w języku polskim
There is also one more situation we can use category-x.php file. This file ‘gathers’ all posts assigned to x category and display them on one page after clicking on category x name. But what if we want to have regular page with some text and all [...]

About category-x.php file

Treść tego wpisu jest dostępna również w języku polskim
The most common purpose for creating and using category-x.php file is to exclude some category from showing on a front page. For example we have category ‘specials’ that can be viewed only after entering category itself but not on the main page.
First we create new file. [...]

Listing posts from one category

Sometime it is needed to display list of all post from only one category in some specified place on your site eg. a sidebar.
To achieve that you need to put following code in the place you want to have that list:
<ul>
<?php
global $post;
$myposts = get_posts(’numberposts=10&order=DESC&orderby=post_date&category=xx’);
foreach($myposts as $post) :
setup_postdata($post);
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li>
<?php endforeach; ?>
</ul>
xx [...]

All authors/users listed

Basically there are two kind of lists of all authors you may want to display.
1. Rather short one you can place in the sidebar for example.
It uses function <?php wp_list_authors(); ?> and following arguments are available:

optioncount: display number of published posts (1=true, 0=false)
exclude_admin
show_fullname; if true first and last name is displayed, if false ‘nickname’ [...]

Particular post displayed in a sidebar

Agrhhh.. It drives me crazy when I need to search through few websites I’ve been working on to find the one with some solution I need again for other project. Thus I’ve made decision. I’m going to publish here all kind of tricks(?)/codes and so on I’ve used. That will serve two purposes:

gather [...]

Text box on each page

To have a text box (or image ) displayed on top of each page (apart from posts in single post view) but above header I have added following piece of code to index.php, page.php and archives.php just bellow <div id="content"> [that’s div which starts content of the page]:
<div id="introtext">
<?php echo ‘This message is [...]

Main Page – one post plus list of titles of other posts

I realize that problem was discussed many times on WP forum and few solutions’ were presented. The one I will describe here worked perfect for me. Actually the only one reason I publish it here is I want keep it in some visible place so I can use it whenever I need it ;).
Changes concern [...]

Page 1 of 3123»