Hi!
I would like to use the appearance of the portfolio in the archives and categories.
I duplicated and renamed the file template.portfolio.php to archive.php and category.php but has failed.
What else should I do?
Thanks
<?php while ( $loop_global->have_posts() ) : $loop_global->the_post(); ?>
<?php while ( have_posts() ) : the_post(); ?>
if (is_page_template( 'template.portfolio.php' ) || is_page_template( 'template.polaroid.php' )) {
..
}
is_tax('jetpack-portfolio-type')
// get the options
$cat_slug = get_theme_mod('writer_portfolio_cat_slug', '');
$articles_amount = get_theme_mod('writer_portfolio_articles', '20');
$columns = get_theme_mod('writer_portfolio_columns', '5');
$columns2 = get_theme_mod('writer_portfolio_columns2', '4');
$columns3 = get_theme_mod('writer_portfolio_columns3', '3');
$columns4 = get_theme_mod('writer_portfolio_columns4', '2');
$columns5 = get_theme_mod('writer_portfolio_columns5', '1');
<?php
/**
* The template for displaying Category pages PORTFOLIO
*
*/
// get the options
$cat_slug = get_theme_mod('writer_portfolio_cat_slug', '');
$articles_amount = get_theme_mod('writer_portfolio_articles', '20');
$columns = get_theme_mod('writer_portfolio_columns', '5');
$columns2 = get_theme_mod('writer_portfolio_columns2', '4');
$columns3 = get_theme_mod('writer_portfolio_columns3', '3');
$columns4 = get_theme_mod('writer_portfolio_columns4', '2');
$columns5 = get_theme_mod('writer_portfolio_columns5', '1');
// amount of one column entries
$one_column_entries = get_theme_mod('writer_one_column_entries', '2');
get_header(); ?>
<div id="gk-content" class="hfeed site fullwidth">
<?php if (is_active_sidebar('top')) : ?>
<?php do_action('writer_before_top'); ?>
<div id="gk-top" role="complementary">
<div class="widget-area gk-3-cols" data-cols="<?php echo GK_Utils::count_sidebar_widgets('top', 3); ?>">
<?php dynamic_sidebar('top'); ?>
</div>
</div>
<?php do_action('writer_after_top'); ?>
<?php endif; ?>
<?php if ( have_posts() ) : ?>
<div id="content" class="site-content" role="main">
<?php do_action('writer_before_content'); ?>
<div class="portfolio-grid with-overlay"
data-cols="<?php echo $columns; ?>"
data-small-desktop-cols="<?php echo $columns2; ?>"
data-tablet-cols="<?php echo $columns3; ?>"
data-small-tablet-cols="<?php echo $columns4; ?>"
data-mobile-cols="<?php echo $columns5; ?>"
>
<?php while ( have_posts() ) : the_post(); ?>
<div class="figure loading">
<?php if ( has_post_thumbnail() ) : ?>
<?php
$data_popup = 'false';
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), apply_filters('writer_portfolio_thumb_size','portfolio-thumb'));
$thumb_full = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full');
$image_url = $thumb[0];
$img_url = get_permalink();
if (get_theme_mod('writer_portfolio_enable_popup', '1') == '1') {
$img_url = $thumb_full[0];
$data_popup = 'true';
}
$title_length = strlen(get_the_title());
?>
<a href="<?php the_permalink(); ?>" class="image-resource" data-url="<?php echo $image_url; ?>">
<img src="#" class="helper-image" alt=""/>
</a>
<?php endif; ?>
<div class="figcaption" data-popup="<?php echo $data_popup; ?>" data-popup-url="<?php echo $img_url; ?>">
<div>
<?php if (get_theme_mod('writer_portfolio_show_title', '1') == '1') : ?>
<h3>
<a href="<?php the_permalink(); ?>" rel="bookmark" class="inverse">
<?php echo substr(get_the_title(), 0, get_theme_mod('writer_portfolio_title_limit', '40')) ; ?>
<?php if ($title_length > get_theme_mod('writer_portfolio_title_limit', '40') ) {
echo '...';
} ?>
</a>
</h3>
<?php endif; ?>
<span>
<?php if (get_theme_mod('writer_portfolio_show_date', '1') == '1') : ?>
<?php
if ('post' == get_post_type() ) {
$date_format = esc_html(get_the_date(get_theme_mod('writer_portfolio_date_format', 'j.m.Y')));
echo sprintf('<time class="entry-date" datetime="'. esc_attr(get_the_date('c')) . '">'. $date_format . '</time>');
}
?>
<?php endif; ?>
<?php if (get_theme_mod('writer_portfolio_show_author', '1') == '1') :
printf( '<a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'writer' ), get_the_author() ) ),
get_the_author()
);
endif; ?>
</span>
</div>
</div>
</div><!-- #post -->
<?php endwhile; ?>
</div>
<?php do_action('writer_after_content'); ?>
</div><!-- #content -->
<?php endif; ?>
<?php if (is_active_sidebar('bottom')) : ?>
<?php do_action('writer_before_bottom'); ?>
<div id="gk-bottom" role="complementary">
<div class="widget-area gk-3-cols" data-cols="<?php echo GK_Utils::count_sidebar_widgets('bottom', 3); ?>">
<?php dynamic_sidebar('bottom'); ?>
</div>
</div>
<?php do_action('writer_after_bottom'); ?>
<?php endif; ?>
</div><!-- #gk-content -->
<?php get_footer(); ?>