Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Uplift › Edit post template
New Landing › How can we help? › Themeforest Theme Support › Uplift › Edit post template
- This topic has 3 replies, 2 voices, and was last updated 8 years by Rui Guerreiro – SUPPORT.
-
Posted in: Uplift
-
January 26, 2017 at 6:27 pm #311539
Hello,
Where can I find post template code? I want to make small changes to the author column.
January 26, 2017 at 6:39 pm #311542Hi,
Can you provide a screenshot with that specific place you want to change?
And the url to that page will also help, so we can see exactly in what template it’s necessary to change.-Rui
January 26, 2017 at 7:36 pm #311559Sure, screen added. It’s a regular post template with author column on the Uplift theme.
I don’t want to share url publicly yet. I could send it privately if you need it.
Attachments:
You must be logged in to view attached files.January 27, 2017 at 5:06 pm #311665Thanks
Just add the code below to the functions.php of your child theme and change it to include whatever your need.
/* * POST INFO OVERRIDE * ------------------------------------------------ * @original - /swift-framework/content/sf-post-detail.php * ================================================== */ if ( ! function_exists( 'sf_post_side_author' ) ) { function sf_post_side_author() { global $post; $sf_options = sf_get_theme_opts(); $author_info = sf_get_post_meta( $post->ID, 'sf_author_info', true ); $social_sharing = sf_get_post_meta( $post->ID, 'sf_social_sharing', true ); $post_date = get_the_date(); $single_author = $sf_options['single_author']; $remove_dates = $sf_options['remove_dates']; $author_id = $post->post_author; $author_name = get_the_author_meta( 'display_name', $author_id ); $author_url = get_author_posts_url( $author_id ); $post_date = get_the_date(); $post_date_str = get_the_date('Y-m-d'); $post_comments = get_comments_number(); if ( is_singular( 'directory' ) ) { $author_info = false; } $post_categories = get_the_category_list( ', ' ); ?> <?php if ( $author_info ) { ?> <div class="side-post-info col-sm-2 clearfix"> <div class="author-avatar"><?php if ( function_exists( 'get_avatar' ) ) { echo get_avatar( get_the_author_meta( 'ID' ), '140' ); } ?></div> <div class="post-details"> <div class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person"> <h5 class="vcard author"><?php echo sprintf( __( 'By <a href="%2$s" rel="author" itemprop="name" class="fn">%1$s</a>', 'uplift' ), $author_name, $author_url ); ?></h5> </div> <?php if ( !$remove_dates ) { ?> <div class="post-date"> <?php echo sprintf( __( '<time datetime="%1$s">%2$s</time>', 'uplift' ), $post_date_str, $post_date ); ?> </div> <?php } ?> <div class="comments-likes"> <?php if ( comments_open() ) { ?> <div class="comments-wrapper"> <a href="#comment-area" class="smooth-scroll-link"><span><i class="sf-icon-comments"></i><?php echo esc_attr($post_comments); ?></span></a> </div> <?php } ?> <?php if ( function_exists( 'lip_love_it_link' ) ) { lip_love_it_link( get_the_ID(), true, '' ); } ?> </div> <?php if ( $social_sharing ) { ?> <div class="post-share"> <a href="#post-share" class="share-link smooth-scroll-link" data-offset="-20"> <i class="sf-icon-share"></i> <span class="share-count">0</span> <span class="share-text"><?php _e("Shares", 'uplift'); ?></span> </a> </div> <?php } ?> </div> </div> <?php } ?> <?php } }
Hope it helps.
-Rui
-
Posted in: Uplift
You must be logged in and have valid license to reply to this topic.