Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Modify related articles
New Landing › How can we help? › Cardinal › Modify related articles
- This topic has 9 replies, 6 voices, and was last updated 9 years by
David Martin – Support.
-
Posted in: Cardinal
-
August 11, 2014 at 8:24 am #99739
Hi,
Here is what i would like to do:At the bottom of my site, there is a related article section. First, i would like to change this from related articles to ” You may also like”.
In addition, for every tile in the related article… i would like to remove the author name from the excerpt. This is all at the eyewear(page) section.
Heres the site : http://www.facexvalue.comAugust 11, 2014 at 10:02 am #99809Hi
Open up: themes/cardinal/swift-framework/content/sf-post-detail.php
And edit line 442:
'<h2 class="heading">'.__("Related Articles", "swiftframework").'</h2>';
– Kyle
September 18, 2014 at 7:42 pm #112326Is there a way to make all the related article items the same size? The text cause awkward breaks in the alignment.
Attachments:
You must be logged in to view attached files.September 19, 2014 at 8:05 am #112437What’s your link? I’ll take a look
– Kyle
January 7, 2016 at 3:45 am #238727I also had a question about this; however, I’m not sure how to get to where you are talking about. Could you please let me know how to change the Related Article heading to something else, but be more specific? Thanks!
January 7, 2016 at 10:26 am #238777Hi,
Please try to use this plugin https://wordpress.org/plugins/real-time-find-and-replace/. Hope it should help to you.
Thanks
MohammadJanuary 7, 2016 at 8:50 pm #238951This reply has been marked as private.January 8, 2016 at 8:14 am #238987Hi,
Please insert Related Articles in Find text box and More dogs Needing a home in Replace text box .
Thanks
MohammadJanuary 8, 2016 at 3:35 pm #239183Did that. Flushed cache. Didn’t work. Could you please take a dive in and see? Thanks!
-Logan
January 8, 2016 at 8:28 pm #239223Hi,
1) Please activate your child theme.
2) Open the child theme functions.php file.
3) Inside that copy and paste this and then find the text below and update “Related Articles” to your required:
/* POST RELATED ARTICES ================================================== */ if ( ! function_exists( 'sf_post_related_articles' ) ) { function sf_post_related_articles() { $related_articles_class = apply_filters( 'sf_post_related_articles_wrap_class', 'container' ); $related_articles_display_type = apply_filters( 'sf_related_articles_display_type', 'bold' ); $related_articles_excerpt_length = apply_filters( 'sf_related_articles_excerpt_length', 20 ); $list_class = 'posts-type-'.$related_articles_display_type; if ($related_articles_display_type == "bold") { $list_class .= ' no-gutters'; } else { $list_class .= ' row'; } global $post; $args = array(); $tags = wp_get_post_tags( $post->ID ); $categories = get_the_category( $post->ID ); if ( ! empty( $tags ) ) { $tag_ids = array(); foreach ( $tags as $individual_tag ) { $tag_ids[] = $individual_tag->term_id; } $args = array( 'tag__in' => $tag_ids, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 4, // Number of related posts to display. 'ignore_sticky_posts' => 1 ); } else if ( ! empty( $categories ) ) { $category_ids = array(); foreach ( $categories as $individual_category ) { $category_ids[] = $individual_category->term_id; } $args = array( 'category__in' => $category_ids, 'post__not_in' => array( $post->ID ), 'posts_per_page' => apply_filters( 'sf_related_posts_count', 4 ), // Number of related posts that will be shown. 'orderby' => 'rand' ); } $related_posts_query = new WP_Query( $args ); if ( $related_posts_query->have_posts() ) { echo '<div class="related-wrap">'; echo '<div class="related-articles ' . $related_articles_class . '">'; echo '<div class="title-wrap"><h3 class="spb-heading"><span>' . __( "Related Articles", "swiftframework" ) . '</span></h3></div>'; echo '<div class="related-items recent-posts '.$list_class.' clearfix">'; while ( $related_posts_query->have_posts() ) : $related_posts_query->the_post(); echo sf_get_recent_post_item( $post, $related_articles_display_type, $related_articles_excerpt_length, 'col-sm-3' ); endwhile; echo '</div>'; echo '</div>'; echo '</div>'; } wp_reset_query(); } add_action( 'sf_post_after_article', 'sf_post_related_articles', 10 ); }
Thanks.
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.