-
7639 readersBefore editing your .htaccess file, always make a backup so you can restore it if needed.
Remove www in url
For SEO reasons, you might always remove (or use) the www prefix in your urls. The following snippet will remove the www from your website url and redirect any url with the www to the non-www version.
-
3496 readersIf you’ve ever used the Twitter API to get the number of your Twitter followers, your latest status updates, or something similar using the Twitter API you may have come across a little problem that has been bugging me for a while. Twitter has a limit on the number of API requests per hour. So,
-
1996 readersChronos Under Construction / Coming Soon Template and WP Theme
It is often the case that a company has acquired the domain name but website itself is still under development. Times of blinking Under Construction GIF files are long gone. CHRONOS tem...
10771 readers
PHP
add_filter('wp_nav_menu_items', 'wps_add_bookmarks', 10, 2);
function wps_add_bookmarks($items, $args) {
$cat = '2'; // define category
$name = 'Bookmarks';
$bookmarks = array();
$bookmarks = get_bookmarks("category=$cat");
if ($bookmarks[0] != '') {
$items .= ''.$name.'';
foreach ( $bookmarks as $bookmark ) {
$items .= ''.$bookmark->link_name.'';
}
$items .= '';
}
return $items;
}
Visit wpsnipp.com
6322 readers
( example screenshot )PHP
add_filter('wp_nav_menu_items', 'add_bookmarks', 10, 2);
function add_bookmarks($items, $args) {
$cat = '2'; // define category
$bookmarks = array();
$bookmarks = get_bookmarks("category=$cat");
if ($bookmarks[0] != '') {
$items .= 'Bookmarks';
foreach ( $bookmarks as $bookmark ) {
$items .= ''.$bookmark->link_name.'';
}
$items .= '';
}
return $items;
}
1733 readersThe default URL for logging into your WordPress powered site is: http://yoursite.com/wp-login.php. Or if you’ve installed in a subdirectory, something like http://yoursite.com/wordpress/wp-login.php. I’ve wished that was a little cleaner, especially when you are doing something explaining to a client where to log in over the phone. Fortunately changing this can be very easy. To make
7460 readers
PHP
function wps_adminbar_bookmarks() {
global $wp_admin_bar;
$cat = '2'; // define category
$name = 'Bookmarks';
$bookmarks = array();
$bookmarks = get_bookmarks("category=$cat");
if ($bookmarks[0] != '') {
$wp_admin_bar->add_menu( array(
'title' => $name,
'href' => false,
'parent' => false
));
foreach ( $bookmarks as $bookmark ) {
$wp_admin_bar->add_menu( array(
'title' => $bookmark->link_name,
'href' => clean_url($bookmark->link_url),
'parent' => strtolower($name),
'meta'
9789 readers.htaccess files are used to configure Apache, as well a range of other web servers. Despite the .htaccess file type extension, they are simply text files that can be edited using any text-editor. In this article, we’ll review what they are, and how you can use them in your projects.
-
2013 readersThis series is supported by Rackspace, the better way to do hosting. Learn more about Rackspace’s hosting solutions here.WordPress is one of the most popular platforms for self-hosted blogs and websites. It’s what…
3315 readersWe recently launched a site called theforgottenletters.org, an incredible project dedicated to translating the Holocaust-era letters of Ralph Schwab from German to English. While building the site, we needed to archive the letters based on the dates the letters were written, not when we publish them to the site. First, I tried this tutorial: How