How to display Twitter-like “time ago” on your WordPress blog

How to display Twitter-like “time ago” on your WordPress blog

The first thing to do is to create the function. To do so, paste the following into your functions.php file:

function time_ago( $type = 'post' ) {
	$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
	return human_time_diff($d('U'), current_time('timestamp')) . " " . __('ago');
}

Once done, you can use the function in your theme files:

<?php echo time_ago(); ?>

Thanks to UpThemes for this trick!

Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!

How to display Twitter-like “time ago” on your WordPress blog

8 useful code snippets to get started with WordPress 3.0

8 useful code snippets to get started with WordPress 3.0

How to create a custom post type

Custom post type are an incredible step forward for WordPress, because it will allow developers to create post types according to their needs.
For now, we have posts, and pages. With WordPress 3.0, we’ll be able to create a new post type called products, where a client can sell his products only, while regular post for his blog.

Creating a custom post type is easy: All you have to do is to open your theme functions.php file and paste the following:

$args = array(
        'label' => __('Products'),
        'singular_label' => __('Product'),
        'public' => true,
        'show_ui' => true,
        'capability_type' => 'page',
        'hierarchical' => false,
        'rewrite' => true,
        'query_var' => 'products',
        'supports' => array('title', 'thumbnail')
);
register_post_type( 'album' , $args );

Once you saved the file, login to your WordPress dashboard and have a look at the navigation on the left: A new post type, named Products, has been added.
Source: http://codex.wordpress.org/Function_Reference/register_post_type

Custom post types with custom taxonomies

In the previous example, I’ve shown you how to create a custom post type, which is pretty useful to use WordPress as a real CMS and not a simple blog publishing platform.

Now, let’s see something a little bit more complex, but extremely interesting: Creating a custom post type associated with custom taxonomies. For those who don’t know, a taxonomy is a term (such as category, tag or anything else) related to posts. For more information about taxonomies, you should have a look at WordPress Codex.

In this example, we’ll create a custom post type named Albums, which belong to “Genres” (the custom categories) and have “Performer” as tags. This snippet has to be pasted in your functions.php file. With those 27 lines of codes, you can create a fully functional music albums archive. Ain’t that powerful?

function post_type_albums() {
	register_post_type(
                     'albums',
                     array('label' => __('Albums'),
                             'public' => true,
                             'show_ui' => true,
                             'supports' => array(
                                        'post-thumbnails',
                                        'excerpts',
                                        'trackbacks',
                                        'comments')
                                )
                      );
// Adding the Custom Taxonomy for Genres. Here we can create categories specific for this post type.
	register_taxonomy( 'genres', 'albums', array( 'hierarchical' => true, 'label' => __('Genres') ) );

// Adding the Custom Taxonomy for Performer. Here we can add tags specific for this post type.
        register_taxonomy( 'performer', 'albums',
		array(
                         'hierarchical' => false,
			 'label' => __('Performer'),
			 'query_var' => 'performer',
			 'rewrite' => array('slug' => 'performer' )
		)
	);
}
add_action('init', 'post_type_albums');

Source: http://wpspecial.net/2010/03/how-to-add-custom-post-types-in-wordpress/

Query custom post types

Now that you’ve learned how to create custom post types, the next step is to learn how to retrieve them from the WordPress database and display it on your blog.

Good news for developers, there’s nothing hard or new in the process. Custom post types can be retrieved easily, using the WP_Query object.
The following example will create a custom loop which will get only the albums custom post type.

<ul>

<?php global $wp_query;
$wp_query = new WP_Query("post_type=albums&post_status=publish");

while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
</ul>

Source:

Enable multisite feature

One of the most exiting new feature of WordPress 3.0 is definitely multisite management. In brief, with a single installation of WordPress you’ll be able to run a network of WordPress blog. How cool is that?

To take advantage of this feature, simply paste the following line of code in your wp-config.php file. This file is located at the root of your WordPress install.

define('WP_ALLOW_MULTISITE', true);

Source: http://wptheming.com/2010/03/wordpress-3-0-enable-network/

Custom author profiles

Most of the top blogs of the industry do not have a single author but a team of different contributors. WordPress allows you to create author pages, but WordPress 3.0 is introducing a new function which will allow you to use different templates for different authors, like we can currently do with categories.

All you have to do is to create an author page named author-XX.php where XX is either the author ID or nicename. For example, if your user nicename is “john”, you’ll have to call the file author-john.php.

Source: http://codex.wordpress.org/Function_Reference/get_author_template

Add custom backgrounds

WordPress 3.0 is introducing a new feature that will for sure be loved by non tech-friendly users: Custom background. The feature allows the user to upload a background in his WordPress dashboard, specify its position, and automatically have it added to his blog.

Of course, the theme used by the blogger has to support this feature, otherwise the uploaded background will not be visible. To do so, simply open your functions.php file and paste the following line:

add_custom_background();

Style WordPress editor using CSS

WordPress features a WYSIWYG editor, which allow you to see text in bold, italic, and so on. But some people want more, such as being able to visualize their blog post in the blog font and colors.

This new feature allows you to create a css file (named editor-style.css in the example below) and link it to the editor for a better WYSIWYG rendering. Simply paste this code snippet to your functions.php file.

add_filter('mce_css', 'my_editor_style');
function my_editor_style($url) {
  if ( !empty($url) )
    $url .= ',';
  // Change the path here if using sub-directory
  $url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css';

  return $url;
}

Source: http://azaozz.wordpress.com/2010/01/02/can-themes-style-the-visual-editor/

Make your theme compatible with WordPress 3.0 menus

WordPress 3.0 is going to feature a totally new menu system, which will allow users to add only the desired pages, add categories, and more. Good news for theme developers; adding WP 3.0 menu support to your themes is extremely easy.

To do so, open functions.php and add the following line:

add_theme_support( 'nav-menus' );

Once added, you can use the brand new wp_nav_menu() function in your theme files:

wp_nav_menu('sort_column=menu_order&container_class=navigation');

As you can see, it accepts the same kind of parameters than the good ol’ wp_list_categories() function.
Source: http://wpspecial.net/2010/04/menu-support-for-wordpress-3-0-themes/

Like CatsWhoCode? If yes, don’t hesitate to check my other blog CatsWhoBlog: It’s all about blogging!

8 useful code snippets to get started with WordPress 3.0

Joomla. Css Module Adjustment.

Joomla. Css Module Adjustment.
I have a Joomla based web site (see it on my development server at www.mindteq.com/ts).
I want to add the Gavick Tabs Manager GK2 module (www.gavick.com, http://tools.gavick.com/demo/tabamanager-gk2).
I did installed it following their instructions but it seems there are some CSS problems as it is not displayed correctly.

See the attached PDF to understand the issue.

The module should be placed in the homepage at the “banner” position.

Clone Of A Facebook Fan Page

Clone Of A Facebook Fan Page
i need a clone of a facebook fan page.

i already have a php file that i was using with my facebook iframing application before the share button stopped to work.
so..everythinbg it is almost done but i need a new working share button to be added on it and some other things that i will tell to the winning coder.

bid on this project only if you are experienced with facebook fan page development.

you will need to use my php file and replace the non working share button with a working one. then you will also need to add something that i will privately explain to the coder.

Completed My Script

Completed My Script
Hello i need a 4 pages small php script, I created this script in html to show you how will be look like this script.

Almost parts of script done in php, just you have to finish it, i attached php codes which done.

Please create this script (design, colors, fonts and functions), the same as is shown.
Main page : http://www.russgift[dot]ru/aa/
Details page: http://www.russgift[dot]ru/aa/details.html

All domains must been search engine friendly and i will be able to use this script in my html pages.

i need it today,
Thanks

Community Website 3

Community Website 3
Hi,
I`m looking for developer/designer to make a website which will be similar to www.modelmayhem.com . I have a template www.modelbook.us you can work off, but its known for coding issues which you need to be able of fixing (i want to repeat myself, you must be proficient at php coding).
I will need to add new features as well as change the design.
Please bid only when you get familiar with model mayhem website.
Please bid only if you confident that you can accomplish this project.
You must show your previous work.
Please bid only if you are capable of day to day communication via msn/icq/facebook chat or any other methods.
If the project works well, in the future i will be looking forward for further development of the website with the person who created it, so don’t miss out… It is a long term relationship.
Very important thing is that the final version of the website must be in a different language. I will take care of translation, but a website you make must be not very hard to translate (I have web design skills, so it will not be a big issue).
Please quote how long (approx) it will take you to complete the project.

Setup 3 WordPress Demo Sites 2

Setup 3 WordPress Demo Sites 2
I need 3 Websites with wordpress setuped with demo content.

You have to setup demo-content (posts and pages) for 3 wordpress sites, so that the sites display all the functions from the installed themes.

You will get the Theme-Docu to check the functions.

Demo 1 and 2
————

Must be refer to http://bonnkapital.de an german insurance company.
You could take the content from the reference site, or setup the needed posts and pages with “lorem ipsum” (100-200 words).

You must upload related images so the sliders and image functions of theme (portfolio page … ) could be watched.

You must setup a contact form. The contact-form-7 plugin is installed and the themes also supports own contact-forms.

The themes are :

PPC Expert Needed. Profit Sharing 50/50 !@ by cadeicon


and

Quick Look: Twithawk

3 Site
——
This will be a site for a bike-company.

You have to do all the things for the first and second site as described.

You have to setup some pages, so this looks like a car-rental system. (Choose bikes, rental-form, …)

You have to setup some pages, so this looks like a webshop (choose categorie with overview, choose product, add to cart, checkout).

All are only demo content, so nothing must be work, but must look like.

The theme is

Using Guitar Amp Simulators 101, Part 3

You have to collect and upload all images.

I will escow 3 Milestone payments, so one payment for each site.

This is a very urgent project.
All sites must be ready on sunday evening.

Web2print B2b Solution

Web2print B2b Solution
Need a web2print programming and a new website design like vistaprint.com,http://iprint.com, http://www.digitalroom.com. Customers will have the capability to:
1) Select a pre-made template (could be business cards, letter head, flyers, etc)
2) customer upload own file for printing and preview proof before sent (PDF)
3) Be able to modify or customize pre-design templates
4) Be able to do all editing with real time preview before order
5) Show be light vistaprint.com as much as possible with its functionality.
6) This programme must be search engine friendly
7) Multi Language (French and English)
8) 2 Online Payment options
9) Enter in his corporate account to have his pre-selected template
Admin should be able to:
————————
1) Add templates with ease.
2) The project the customer completed should be PRINT ready – ie, CMYK output of PDF or other CMYK formats.
3) Admin should be able to print multiple business cards per page
4) Should be able to process credit card and or paypal payment 🙂
5) Customize the layout with ease.
6) Should be able to integrate not only business cards, but other print products such as Banner, Offset print digital print,Postcards, Flyers, etc.
7) Should be able to add pre-made template

Its more for B2B application for large corporation that have many repetitive print with same kind of changes every time…

Would be happy to work with the right programmer to get the right product.

Thanks

Jw Flv Player Modification

Jw Flv Player Modification
Hello,

i need to modify this version of the player ( old AS2 player ):

http://developer.longtailvideo.com/trac/browser/tags/mediaplayer-3.17

Various type of file are allowed, but i need to implement the possibility to load custom external XML file ( with custom structure )
The file extension isn’t .xml, :

The flashvar file variable of the player will be file=CODE ( where code is an ID number )

When the player start if the type of video is this one ( actually the user can specify a flash variable “type=file_type” i need to be able to setup a custom type variable like “type=special”), the player automatically connect to a PHP file inside an external server:

http://www.mywebvideo.com/get_video.php?id=CODE

The server send back an XML file.

Inside the XML file a node contain the FLV link ( i will provide the xml structure).

The player extract the FLV link and play them.

Fashion Store Web Designer

Fashion Store Web Designer
I have a online fashion store.
I already have a template from the monstertemplate, the website already on the temporary web.
Basically 90% is done.
I just need a designer who can design product description page to my needs, and the better store buttons like
“add to cart”
“continue”
“back” etc..

Php and programing is NOT required.
I just need to someone to design it in photoshop or any graphic software and give me the cutouts.

I need someone with the cutting edge eye for the design.

Articles Required – 3 Articles

Articles Required – 3 Articles
Please only bid on this project if you can meet my deadline, have perfect English and can write original error-free articles.

I need three (3) well written articles written for my new unique business.
The articles must be informative and well-researched via my website as the concept is new. I will provide more information to the selected writer. The articles must be written in perfect English with correct punctuation and grammar. The finished work must be easy to understand and read; and also flow smoothly when read.

I do not want to have to edit the finished articles – so please message me one sample proof of an article you have written in the past for me to judge the standard of your work when you place your bid.
All articles must be original and pass through CopyScape.

I require 3 articles, each with 350-400 words each. I will provide keywords to the selected bidder.
Keyword density 2.5-2.8

The articles must be delivered within 5 days of the job being awarded.

Payment will be 100% in Escrow until project is complete.

Even though I have not specified a budget the price is an highly influencing factor in who will be selected.

Many thanks.

Home Swap Website Design & Dev

Home Swap Website Design & Dev
Need to customize a home swap/house exchange website. I know there are a lot of open source packages out there but i am willing to pay to customise this to my needs.

1- Member’s ability to post listings and photos with a google map link to address/location
2- Credit card and paypal payment methods
3- Ability to include third party advertising such as google adsense and graphic banners
4- Registered members only can see listing contact details
5- Home page customization and some graphic design work
6- other creative ideas will be rewarded.

Please view the following websites to have an idea about my needs:

www.homeexchange.com
www.homexchangevacation.com
www.homeforexchange.com

when winner bidder will be resposible for Program Functionality: Making the website “work”.