30% discount on all membership plans including SP Page Builder Details

Blog

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

If you are thinking of starting a green business, consider to use our new Wordpress theme called "Organic Life". Theme we made it allows you easy to sell natural products or just only promote healthy life style, recipes or different local shops with organic food. The main idea behind that WP theme was to help You begin eco-friendly website with attention to nature and organic products.  If you want to have a “green” business (healthy food, ecology or recycling), you've just found design for it.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

You are the owner of night or music club, maybe you are popular DJ or just planning festival, convention or other party and you would like to show your entire event offer and introduce them to everyone. You need a WordPress Theme to make your website become more attractive and impressive. The Vocal theme developed by our team is what you need, beautiful, feature-rich, easy-to-use, and adaptive.

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

WordPress is increasingly became the most popular content management system of choice for the average user. Many Joomla users that started their blog or small site are now considering moving to WordPress, some others faced with the need to move to a Wordpress because of problems with their current old Joomla version installation. In this tutorial we will show you how to make a content transfer (migrate) from all Joomla versions 1.5, 1.6, 1.7, 2.5, 3.0, 3.1, 3.2 and 3.3 to Wordpress platform.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

As you're interested in generating websites based on WordPress, you'll be very happy to know that our JoomShaper team also loves Wordpress and its themes. We all know that this CMS has changed a lot since his beginning, now is much easier to use and also it increasingly powerful. Maybe that's why WordPress became one of the most popular open source content management systems available, with global and vibrant user, developer, and great number of available plugins.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

My last tutorial was Create Custom Post Type in WordPress. Before read this tutorial please take a view in past article. Today we will discuss some advanced features in WordPress Custom Post Type. Personally i lke Custom Post Type very much. It is very handy and most powerful feature comes with WordPress.

Why Use Custom Meta Fields?

Custom fields allows you to make your WordPress backend customizable and managable easily. Example, you want to create a Portfolio Section for your own collection of works. It may be include fields like- Portfolio Title, Description, Website URL, Thumbnail Image etc. You cann't get all the fields you need, built in with WordPress. 

GET STARTED!!!

To create custom meta boxes, you have to learn about action hooks, that create a meta box and save it in the 'prefix_postmeta" table in Database.

Register Meta Box with action hook in your functions.php page in the theme folder.

{codecitation style="brush: php;"}

//Create Custom Meta Box
add_action('add_meta_boxes','sp_portfolio_meta');

{/codecitation}

Save Registered Meta box content

{codecitation style="brush: php;"}

add_action('save_post','sp_portfolio_meta_save');

{/codecitation}

The above two line can boost up your WordPress development time. Now we can start our little project details-

Create a function and hook it admin_init

{codecitation style="brush: php;"}

add_action('admin_init','sp_portfolio_meta');

{/codecitation}

Now we will bind register and save meta box in sp_portfolio_meta function.

{codecitation style="brush: php;"}

function sp_portfolio_meta()
{
// add a meta box for WordPress 'Portfolio' type
add_meta_box(

                         'sp_portfolio',    //ID 

                         'Portfolio URL',  //Meta Box Title

                         'sp_portfolio_meta_setup',   //Our call back function

                          'portfolio',  //Post Type

                           'side', //Placement of the meta box i.e- normal/side

                           'low');  //Priority low/high



// add a callback function to save any data a user enters in

add_action(

                   'save_post', //Triggered when post type is created/updated

                   'sp_portfolio_meta_save' //Callback function

);
}

{/codecitation}

In the above two line of function we have done everything we should do to work with WordPress Meta Boxes. There is some small tricks you might know-

The placement of add_meta_box we have placed in side. That means it will show right side. If you replace side with normal then it will be  shown after the Editor. This is really a handy tool to beautification of your Post Types.

Another is Priority-low. If we replace low with high then it will show at the first most position of right side. That means it will get highest priority. 

Now we will see how is easier to play with custom meta boxes. Create the callback function with your functionalities-

{codecitation style="brush: php;"}

function sp_portfolio_meta_setup()
{
global $post;

?>
<div class="portfolio_meta_control">

<p>
<input type="text" name="_url" value="<?php echo get_post_meta($post->ID,'_url',TRUE); ?>" style="width: 100%;" />
</p>
</div>
<?php

// create for validation
echo '<input type="hidden" name="sp_meta_nonce" value="' . wp_create_nonce(__FILE__) . '" />';
}

{/codecitation}

We have validate the input Portfolio URL with wp_create_nonce() function. 

{codecitation style="brush: php;"}

function sp_portfolio_meta_save($post_id)
{
if(isset($_POST['_url']))
{
update_post_meta($post_id, '_url', $_POST['_sp_banner_des']);
}

{/codecitation}

 

Our final Portfolio URL will be like below-

Happy WordPress Development !!!

 

 

 

User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

The beauty of wordpress that you can customize your site as you want. You can create custom posts of your blog or website. Extending the feauters of WordPress you can easily create a site like Youtube, BBC. There are five post types built in WordPress. Custom Post Types are-

 

  1. Post
  2. Page 
  3. Attachment
  4. Revision and 
  5. Navigation

To create a custom Post Type, you have to create some functions in your theme fuctions.php or you can create a new Plugin file. Open your theme functions.php with your suitable Editor. I am using Sublime Text 2. For example you want to create a Portfolio section in your website.

It's up to you that you want to create the Portfolio section as post or page type. It's called "capability_type".

Register a function

{codecitation style="brush: php;"}add_action( 'init', 'sp_portfolio' );{/codecitation}

See the init action Reference for WordPress. Now we referenced the sp_portfolio function by creating a new function. 

{codecitation style="brush: php;"}

function sp_portfolio() {
$labels = array(
'name' => _x( 'Portfolio', 'post type general name' ),
'singular_name' => _x( 'Portfolio', 'post type singular name' ),
'add_new' => _x( 'Add New', 'book' ),
'add_new_item' => __( 'Add New Portfolio' ),
'edit_item' => __( 'Edit Portfolio' ),
'new_item' => __( 'New Portfolio Items' ),
'all_items' => __( 'All Portfolio' ),
'view_item' => __( 'View Portfolio' ),
'search_items' => __( 'Search Portfolio' ),
'not_found' => __( 'No Portfolio Items found' ),
'not_found_in_trash' => __( 'No Portfolio Items found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'SP Portfolio'
);
$args = array(
'labels' => $labels,
'description' => 'Holds Portfolio specific data',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type'=> 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail'),
);
register_post_type( 'portfolio', $args );
}

{/codecitation}

We have registered a new Post Type name 'portfolio'. Please check details about register_post_type. There are some terms you have to remember-

{codecitation style="brush: php;"}register_post_type($post_type, $args){/codecitation}

$post_type: The Post Type name. It must be in in lowercase. It shouldn't contain in Capital words, no spaces. 

$args: args is an array of arguments.

$labels: Defines an array of label elements. 

$menu_position: Menu position where you want to show your Post Types in your WordPress Dashboard. 

supports: Added supports by post types. All supports by post types are- title, editor, author, thumbnail, excerpt, trackback, custom-fields, comments, revisions, page-attributes, post-formats.

The final output of our above code is shown below-