New Landing How can we help? Cardinal Modify related articles

Viewing 10 posts - 1 through 10 (of 10 total)
  • Posted in: Cardinal
  • #99739
    syahrul123
    Member
    Post count: 26

    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.com

    #99809
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Open up: themes/cardinal/swift-framework/content/sf-post-detail.php

    And edit line 442:

    '<h2 class="heading">'.__("Related Articles", "swiftframework").'</h2>';

    – Kyle

    #112326
    nathanscamera
    Member
    Post count: 130

    Is 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.
    #112437
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    What’s your link? I’ll take a look

    – Kyle

    #238727
    loganwilliamson
    Member
    Post count: 75

    I 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!

    #238777
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please try to use this plugin https://wordpress.org/plugins/real-time-find-and-replace/. Hope it should help to you.
    Thanks
    Mohammad

    #238951
    loganwilliamson
    Member
    Post count: 75
    This reply has been marked as private.
    #238987
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please insert Related Articles in Find text box and More dogs Needing a home in Replace text box .
    Thanks
    Mohammad

    #239183
    loganwilliamson
    Member
    Post count: 75

    Did that. Flushed cache. Didn’t work. Could you please take a dive in and see? Thanks!

    -Logan

    #239223
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    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.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register