Anyone who operates a community using WordPress, and would like to display the total number of registered users, can easily and quickly use the following small code snippet.
It reads via SQL the content of the table "
users", and the numbers of IDs getting counted. This value simply gets wrapped around a text.
$myusers = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo sprintf( __('We have %s registered user.', 'myTextDomain') , $myusers );
Enjoy our 5th post of our Advent Calendar: More and more WordPress themes, especially commercial themes, have an option page. The settings are stored in the database. Only few themes have an uninstall button to delete these settings in your database.
Continue reading …
WordPress 2.9 will support the attribute
rel and his value
canonical, you can also read about it on an older post how to integrate the values and what's about it. Therefore you don't have to paste the HTML explicitly in your theme.
In previous versions of WordPress 2.9, the intergration is easy to do:
<?php if ( is_singular() ) echo '<link rel="canonical" href="' . get_permalink() . '" />'; ?>
Putting it in the header.php of the theme is the easiest way to have the link-tag in the
head of your frontend.
Since WordPress 2.9 it won't be necessary because WordPress set with the help of the default filter, see
link-tag to the hook
add_action( 'wp_head', 'rel_canonical' );
Thereby it calls the function
rel_canonical(), which simply writes the HTML and passes the link of the article. Alternatively you can disable the filter and you can use it yourself.
remove_action( 'wp_head', 'rel_canonical' ); // to delete in head
Especially in Germany we have the tradition of an Advent Calendar. An Advent calendar is a special calendar which is used to count down the days from December the 1st to Christmas Eve December 24th.
An Advent Calendar has 24 doors, one of which is opened every day during Advent. Each door opens to reveal an image, a poem, or part of a story such as the Nativity story itself. More elaborate Advent calendars have a small gift concealed in each door, such as a toy or a chocolate item.
At WP Engineer, we thought we should do the same and open a door every day, which contains a little gift for our readers, by providing them a WordPress tip or trick each day. So we hope you will be exciting to see what tip, hack or news will be behind the door the next morning. Enjoy a new little WordPress gift every day until December 24th. 🙂
Our first little gift is a code snippet to implement the commentform as a widget in your sidebar. This Widget only works with WordPress 2.8 and higher since it's using the new Widget API. Just paste the code in the functions.php of your theme and drag the Widget on your sidebar.
Continue reading …
On one of my domains I installed WordPress MU a few days ago. There will be a German and an English blog, which both have the same content and are also the same theme. In WordPress MU, it is possible to choose a separate blog for each language. Continue reading …