Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Uplift › Excerpt & Read More Link on category pages
New Landing › How can we help? › Themeforest Theme Support › Uplift › Excerpt & Read More Link on category pages
- This topic has 2 replies, 2 voices, and was last updated 8 years by David Martin – Support.
-
Posted in: Uplift
-
June 13, 2016 at 10:19 pm #274398
I choosed a standard display on Category/Archive page, but it appears that the excerpt of posts show only the first line and the Read More button is not visible.
I would like the category pages to display as the home page with full excerpt and read more link. How can I do this ?
File Untitled 1 shows what I get on category page
File Untitled 2 what I get on the Home PageAttachments:
You must be logged in to view attached files.June 13, 2016 at 10:48 pm #274409Found the solution.
You can duplicate in the child them swift-framework > layout > archive.phpand copy paste this code
<?php
$sf_options = sf_get_theme_opts();$blog_type = $sf_options[‘archive_display_type’];
$blog_classes = sf_blog_classes( $blog_type );
$columns = 2;
$pagination = “standard”;
$pagination_output = “”;
if ( isset($sf_options[‘archive_display_columns’]) ) {
$columns = $sf_options[‘archive_display_columns’];
}
if ( isset($sf_options[‘archive_display_pagination’]) ) {
$pagination = $sf_options[‘archive_display_pagination’];
}
$content_output = $sf_options[‘archive_content_output’];
$item_class = $blog_classes[‘item’];
$show_read_more = “yes”; //——————CUSTOM CHANGE
$excerptLength = “80” ; //——————CUSTOM CHANGEif ( $blog_type == “masonry” ) {
if ( $columns == “5” ) {
$item_class = “col-sm-sf-5”;
} else if ( $columns == “4” ) {
$item_class = “col-sm-3”;
} else if ( $columns == “3” ) {
$item_class = “col-sm-4”;
} else if ( $columns == “2” ) {
$item_class = “col-sm-6”;
} else if ( $columns == “1” ) {
$item_class = “col-sm-12”;
}if ( $content_output == “excerpt” ) {
$show_read_more = “yes”;
}
}
?><div class=”blog-wrap blog-items-wrap blog-<?php echo esc_attr($blog_type); ?>”>
<?php if ( have_posts() ) : ?>
<?php if ( $blog_type == “timeline” ) { ?>
<div class=”timeline”></div>
<?php } ?><!– OPEN .blog-items –>
<ul class=”blog-items row <?php echo esc_attr($blog_classes[‘list’]); ?> clearfix”
data-blog-type=”<?php echo esc_attr($blog_type); ?>”><?php while ( have_posts() ) : the_post(); ?>
<?php
$post_format = get_post_format( $post->ID );
if ( $post_format == “” ) {
$post_format = ‘standard’;
}
?>
<li <?php post_class( ‘blog-item ‘ . $item_class . ‘ format-‘ . $post_format ); ?> itemscope itemtype=”http://schema.org/BlogPosting”>
<?php echo sf_get_post_item( $post->ID, $blog_type, “yes”, “yes”, “yes”, $excerptLength, $content_output, $show_read_more ); //CUSTOM CHANGE
?><?php endwhile; ?>
<!– CLOSE .blog-items –>
<?php else: ?>
<h3><?php _e( ‘Sorry, there are no posts to display.’, ‘uplift’ ); ?></h3>
<?php endif; ?>
<?php if ( $pagination == “infinite-scroll” ) {
$pagination_output .= ‘<div class=”pagination-wrap hidden infinite-scroll-enabled”>’;
$pagination_output .= pagenavi( $wp_query );
$pagination_output .= ‘</div>’;} else if ( $pagination == “load-more” ) {
$pagination_output .= ‘‘ . __( ‘Load More’, ‘uplift’ ) . ‘‘;
$pagination_output .= ‘<div class=”pagination-wrap load-more hidden infinite-scroll-enabled”>’;
$pagination_output .= pagenavi( $wp_query );
$pagination_output .= ‘</div>’;} else if ( $pagination == “standard” ) {
if ( $blog_type == “masonry” ) {
$pagination_output .= ‘<div class=”pagination-wrap masonry-pagination”>’;
} else {
$pagination_output .= ‘<div class=”pagination-wrap”>’;
}
$pagination_output .= pagenavi( $wp_query );
$pagination_output .= ‘</div>’;
}
echo $pagination_output;
?></div>
June 14, 2016 at 7:08 pm #274736Glad you got this sorted.
Thanks.
-
Posted in: Uplift
You must be logged in and have valid license to reply to this topic.