رفتن به مطلب

در مورد portfolio


mehdiiiii

پست های پیشنهاد شده

سلام دوستان

از قالبی استفاده میکنم که portfolio روش هست

میخواستم بدونم چطوری میشه که تصویر شاخص و

Project Details رو نمایش نده تو صفحه ای که با portfolio میسازیم؟

ممنون میشم اگه راهنمایی کنید

post-11030-0-44219500-1438088427_thumb.j

لینک به ارسال

سلام ، به انجمن خوش اومدید.

لطفاً محتویات فایل portfolio.php و content.php ، loop.php رو در صورت وجود توی انجمن از طریق BBCode مخصوص longbox بذارید تا بررسی بشه.

  • امتیاز 1
لینک به ارسال

content.php

<?php

global $ht_options;

$thumbnail_size = 'blog-post-thumbnail';

if ( $ht_sidebar_status == 'no-sidebar' ) {

$thumbnail_size = 'full-width';

}

$post_images = array();

$zoom = 'zoom';

$featured_image_status = get_post_meta($post->ID, '_ht_disable_post_image', true);

$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), $thumbnail_size);

$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');

$slider_images = get_post_meta( get_the_ID(), '_ht_slider_images', true);

$post_excerpt_length = ($ht_options['post_excerpt_length']) ? $ht_options['post_excerpt_length'] : 300;

if( $featured_image_status =='' && $ht_options['disable_post_image'] =='1' ) {

$featured_image_status = 'false';

}

$lightbox_status = '';

if( $ht_options['blog_lightbox'] ) {

$lightbox_status = 'href="'. get_permalink() .'"';

$zoom = '';

} else {

$lightbox_status = 'data-gal="lightbox" href="' . $large_image_url[0] .'"';

}

if( is_array($slider_images) ) {

foreach ( $slider_images as $slider_image ) {

$post_images[] = wp_get_attachment_image_src( $slider_image , $thumbnail_size);

$post_large_images[] = wp_get_attachment_image_src( $slider_image , 'large');

}

}

if(get_post_type() =='page' || get_post_type() =='portfolio') {

?>

<div <?php post_class('post'); ?>>

<?php

$post_format_icon = 'icon_document_alt ';

if( get_post_type() =='page' ) {

$post_format_icon = 'icon_document_alt';

} else {

$post_format_icon = 'icon_star_alt ';

}

?>

<div class="meta_box">

<div class="post_format"><i class="<?php echo $post_format_icon;?>"></i></div>

<h3> <a title="<?php the_title_attribute();?>" href="<?php the_permalink();?>"><?php the_title();?></a></h3>

<div class="post_meta">

<span><i class="icon_clock_alt"></i> <?php the_time(get_option('date_format'));?></span>

</div><!-- meta more -->

</div><!-- meta box -->

<div class="post_content clearfix">

<p>

<?php echo ht_excerpt($post_excerpt_length, '...'); ?>

</p>

</div>

</div><!-- .post -->

<?php } else {?>

<div <?php post_class($masonry_class); ?>>

<?php

// include post meta

get_template_part('includes/templates/content-meta');

// include post thumbnail

if( !is_search() ) {

include(locate_template('includes/templates/post-thumbnail.php'));

}

?>

<div class="post_content clearfix">

<?php if($ht_options['disable_excerpt'] != '1') { ?>

<p>

<?php echo ht_excerpt($post_excerpt_length, '...'); ?>

</p>

<?php } else { the_content(__('Continue Reading<i class="fa-double-angle-right"></i>','highthemes')) ; } ?>

</div>

</div>

<?php }?>

این

portfolio.php تو پوشه includes/post-types هست

/**

*

* HighThemes Options Framework

* twitter : http://twitter.com/theHighthemes

*

*/

<?php

add_action('init', 'ht_portfolio_type');

function ht_portfolio_type() {

global $ht_options;

$portfolio_slug = 'portfolio';

if(isset($ht_options['folio_slug']) && $ht_options['folio_slug'] !=''){

$portfolio_slug = strtolower($ht_options['folio_slug']);

}

$portfolio_cat_slug = 'portfolio-category';

if(isset($ht_options['folio_cat_slug']) && $ht_options['folio_cat_slug'] !=''){

$portfolio_cat_slug = strtolower($ht_options['folio_cat_slug']);

}

$labels = array(

'name' => __('Portfolio','highthemes'),

'singular_name' => __('Portfolio Item','highthemes'),

'add_new' => __('Add New','highthemes'),

'add_new_item' => __('Add New Item','highthemes'),

'edit_item' => __('Edit Item','highthemes'),

'new_item' => __('New Item','highthemes'),

'view_item' => __('View Portfolio Item','highthemes'),

'search_items' => __('Search Portfolio Items','highthemes'),

'not_found' => __('No items found','highthemes'),

'not_found_in_trash' => __('No items found in Trash','highthemes'),

'parent_item_colon' => ''

);

$args = array(

'labels' => $labels,

'public' => true,

'publicly_queryable' => true,

'show_ui' => true,

'query_var' => true,

'rewrite' => array(

'slug' => $portfolio_slug

),

'capability_type' => 'post',

'hierarchical' => false,

'menu_position' => 5,

'menu_icon' => 'dashicons-portfolio',

'supports' => array('title','editor','author','thumbnail','excerpt','comments'),

);

register_post_type( 'portfolio' , $args );

// register custom taxonomy for portfolio

register_taxonomy('portfolio-category',array('portfolio'), array(

'hierarchical' => true,

'show_ui' => true,

'query_var' => true,

'rewrite' => array(

'slug' => $portfolio_cat_slug

)

));

}

add_filter('post_updated_messages', 'portfolio_updated_messages');

function portfolio_updated_messages( $messages ) {

global $post, $post_ID;

$messages['portfolio'] = array(

0 => '', // Unused. Messages start at index 1.

1 => sprintf( __('Item updated.','highthemes') . ' <a href="%s">'. __('View Item', 'highthemes') . '</a>', esc_url( get_permalink($post_ID) ) ),

2 => __('Custom field updated.','highthemes'),

3 => __('Custom field deleted.','highthemes'),

4 => __('Item updated.','highthemes'),

/* translators: %s: date and time of the revision */

5 => isset($_GET['revision']) ? sprintf( __('Item restored to revision from','highthemes') . ' %s', wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,

6 => sprintf( __('Item published','highthemes').' <a href="%s">'.__('View Item','highthemes').'</a>', esc_url( get_permalink($post_ID) ) ),

7 => __('Item saved.','highthemes'),

8 => sprintf( __('Item submitted.','highthemes').' <a target="_blank" href="%s">'.__('Preview Item','highthemes').'</a>', esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),

9 => sprintf( __('Item scheduled for:','highthemes').' <strong>%1$s</strong>. <a target="_blank" href="%2$s">'.__('Preview Item','highthemes').'</a>',

// translators: Publish box date format, see http://php.net/date

date_i18n( 'M j, Y @ G:i', strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),

10 => sprintf( __('Item draft updated. ','highthemes') . '<a target="_blank" href="%s">'.__('Preview Item','highthemes').'</a>', esc_url( add_query_arg( __('preview','highthemes'), 'true', get_permalink($post_ID) ) ) ),

);

return $messages;

}

//add thumbnail col to portfolio list

if ( !function_exists('ht_add_thumb_col') && function_exists('add_theme_support') ) {

function ht_add_thumb_col($cols) {

$cols['thumbnail'] = __('Thumbnail','highthemes');

return $cols;

}

function fb_add_thumb_value($column_name, $post_id) {

$width = (int) 80;

$height = (int) 80;

if ( 'thumbnail' == $column_name ) {

// thumbnail of WP 2.9

$thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

// image from gallery

$attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );

if ($thumbnail_id)

$thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );

elseif ($attachments) {

foreach ( $attachments as $attachment_id => $attachment ) {

$thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );

}

}

if ( isset($thumb) && $thumb ) {

echo $thumb;

} else {

echo __('None','highthemes');

}

}

}

// for posts

add_filter( 'manage_posts_columns', 'ht_add_thumb_col' );

add_action( 'manage_posts_custom_column', 'fb_add_thumb_value', 10, 2 );

// for pages

add_filter( 'manage_pages_columns', 'ht_add_thumb_col' );

add_action( 'manage_pages_custom_column', 'fb_add_thumb_value', 10, 2 );

// for portfolio

add_filter( 'manage_portfolio_columns', 'ht_add_thumb_col' );

add_action( 'manage_portfolio_custom_column', 'fb_add_thumb_value', 10, 2 );

}

?>

این portfolio.php تو پوشه includes/theme-options هست

<?php

/* Portfolio */

/*-----------------------------------------------------------------------------------*/

$of_options[] = array("name" => __("Portfolio Settings", "highthemes"),

"type" => "heading");

$of_options[] = array("name" => __("Portfolio Archive Page Layout", "highthemes"),

"desc" => __("Select the portfolio archive page template", "highthemes"),

"id" => "folio_archive_layout",

"std" => '3col',

"type" => "select",

"options" =>array("2col"=>"2 Column", "3col"=>"3 Column", "4col" =>'4 Column')

);

$of_options[] = array("name" => __("Portfolio Slug", "highthemes"),

"desc" => __("Default Portfolio slug is 'portfolio', if you would like to change it, enter your desired slug here. It will appear in portfolio items' urls. Note that if you change it you will need to open admin panel, change permalink structure to default, save website and then revert it to previous state. ", "highthemes"),

"id" => "folio_slug",

"std" => "",

"type" => "text");

$of_options[] = array("name" => __("Portfolio Category Slug", "highthemes"),

"desc" => __("Default Portfolio category slug is 'portfolio-category', if you would like to change it, enter your desired slug here. It will appear in portfolio categories' urls. Note that if you change it you will need to open admin panel, change permalink structure to default, save website and then revert it to previous state. ", "highthemes"),

"id" => "folio_cat_slug",

"std" => "",

"type" => "text");

$of_options[] = array("name" => __("Related Items Title", "highthemes"),

"desc" => __("Default title is Related Items, you can change it here.", "highthemes"),

"id" => "related_folio_title",

"std" => "",

"type" => "text");

$of_options[] = array("name" => __("Related Items Description", "highthemes"),

"desc" => __("Enter a short description for portfolio related items.", "highthemes"),

"id" => "related_folio_desc",

"std" => "",

"type" => "textarea");

$of_options[] = array("name" => __("Disable Related Items", "highthemes"),

"desc" => __("Check this box to disable related items for portfolio single page.", "highthemes"),

"id" => "disable_related_folio",

"std" => 0,

"type" => "checkbox");

loop.php وجود نداشت

با تشکر

لینک به ارسال

متأسفانه قالب های highthemes تجاری هستن و بحث در مورد اون ها در انجمن کاملاً ممنوع هست.

موفّق باشید.

  • امتیاز 2
لینک به ارسال
مهمان
این موضوع برای عدم ارسال قفل گردیده است.
×
×
  • اضافه کردن...