Thanks for your help!
Here is the code for portfolio.php
<?php
/*
Template Name: Portfolio
*/
?>
<?php get_header(); ?>
<div id=”content”>
<?php
$type = ‘portfolio’;
$args=array(
‘post_type’ => $type,
‘post_status’ => ‘publish’,
‘paged’ => $paged,
‘posts_per_page’ => 9,
‘caller_get_posts’=> 1
);
$temp = $wp_query; // assign original query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query($args);
?>
<?php if($wp_query->have_posts()) : while($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div id=”portfolio-item”>
<h1><?php the_title(); ?></h1>
“><?php the_post_thumbnail(); ?>
<?php the_content(); ?>
</div>
<?php endwhile; else : ?>
<?php endif; ?>
</div>
<div align=”right”>
<?php if(function_exists(‘wp_pagenavi’)) { wp_pagenavi(); }
$wp_query = null; $wp_query = $temp; ?>
</div>
<?php get_footer(); ?>
and here is the code for function:
<?php
// Create Portfolio
add_action(‘init’, ‘create_portfolio’);
function create_portfolio() {
$portfolio_args = array(
‘label’ => __(‘Portfolio’),
‘singular_label’ => __(‘Portfolio’),
‘public’ => true,
‘show_ui’ => true,
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘rewrite’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’)
);
register_post_type(‘portfolio’,$portfolio_args);
}
?>
<?php
add_action(“admin_init”, “add_portfolio”);
add_action(‘save_post’, ‘update_website_url’);
function add_portfolio(){
add_meta_box(“portfolio_details”, “Portfolio Options”, “portfolio_options”, “portfolio”, “normal”, “low”);
}
function portfolio_options(){
global $post;
$custom = get_post_custom($post->ID);
$website_url = $custom[“website_url”][0];
?>
<div id=”portfolio-options”>
<label>Website URL:</label><input name=”website_url” value=”<?php echo $website_url; ?>” />
</div><!–end portfolio-options–>
<?php
}
function update_website_url(){
global $post;
update_post_meta($post->ID, “website_url”, $_POST[“website_url”]);
}
?>
<?php
add_filter(“manage_edit-portfolio_columns”, “portfolio_edit_columns”);
add_action(“manage_posts_custom_column”, “portfolio_columns_display”);
function portfolio_edit_columns($portfolio_columns){
$portfolio_columns = array(
“cb” => “<input type=\”checkbox\” />”,
“title” => “Project Title”,
“description” => “Description”,
);
return $portfolio_columns;
}
function portfolio_columns_display($portfolio_columns){
switch ($portfolio_columns)
{
case “description”:
the_excerpt();
break;
}
}
?>
There are too much longer… :D..
Please help me out of this problem!