Blog

How to add featured Image Support.

Lets talk about another wordpress trick.

Have you ever opened your post editor and found there is no featured image box in it?

A lot will say “yes”

The reason being that wordpress requires you to add theme support for thumbnails manually through your functions.php or some plug-in.

Adding the support manually is very simple. Open the functions.php file which lies in your active theme’s folder and paste this code.

Adding theme support for all post types.
add_theme_support(‘post-thumbnails’);
Adding support only for pages.
add_theme_support(array(‘page’));

Adding Thumbnail Sizes
You can add an option so that all thumbnails have an exact size and will be cropped to that size without keeping the aspect ratio of the image by setting a size and setting the third crop parameter to be true, as shown below
set_post_thumbnail_size(150,150,true);
For using the thumbnail in theme, there are three functions.

has_post_thumbnail() returns ‘true’ if a thumbnail has been set
the_post_thumbnail() echos a string containing the thumbnail < img alt=”” / > tag
get_the_post_thumbnail() returns a string containing the thumbnail < img alt=”” /> tag

Read more about thumnail on this link

Highlight Search Term in Search Results

Using wordpress native search, you can use this trick to highlight the search term in the title in the search results. This can be done by tokeinizing the title and then assigning a css class to the search word. This css class can be styled with background color to highlight the search word. Use this code in funtions.php

Last but not the least, paste this in your style.css

You can also use this plugin to achieve the same funtionality without writing any code yourself. Hope you like this wordpress snippet 🙂

Pronto – Portfolio theme

A clean and minimal portfolio theme by wpexplorer.com . It has a grid layout, post-based theme, no custom-post, threaded comment supoort and author pages.
Download Preview

Use a Default Theme Background for WordPress Theme Options

You can add theme support for background image. If user does not choose an image, a default image will be set as theme background image. Use this code in functions.php

add_theme_support( ‘custom-background’, array(
‘default-image’ => get_template_directory_uri() . ‘/images/default-background.png’,
) );

SOFA SHOPPR

Beautiful WordPress theme designed by themeforest. Switchable layout, support for background and menus, inventory manager and much more.(premium)
Preview  Info

Wp e-buy Ecommerce

An ecommerce theme which is professionaly designed, SEO optimized and great for an online shop.

Download  Preview

World Business Sillhoute

Designed by LeadCamp Inc. Blue theme ideal for company website.

Download    Preview

Sunrise Over Hills

Design by Neat Colorful Design, two Columns with Right Sidebar.

Download  Preview

Witcher World

Elegant and simple theme with change header banner support.

Download

 

WordPress Private Message System Plugin

 

While looking for plugins to implement ‘Private message system’ between users in wordpress, i found a not so-famous but awesome plugin called ‘Cartpauj PM’. The plugin has a very neat code, interface and functionality. The code is based on OOP with nicely defined functions.

You can cal any function anywhere to have a part of functionality of the plugin. The plugin also has a skin/mod available, which has some css, images and nice layouts for plugin’s frontend pages. The cartpauj website has a number of other plugins as well and also a support forum for their plugins.