Profile photo of Yarko GurYarko Gur
asked 2 years ago

Hi, use DW Minion and cant understand how i can paste code of social links after content article and before comments. Try to use file (single.php) but it paste or in the wrong place or theme not working.

2 Answers
Dominic
answered 2 years ago

Hi,
If you want to display the social links after content article and before comments section, you can open the single.php file then add your shortcode under line 7: get_template_part( 'content', 'single' );

For Example: I have used The Social Link plugin, after settings plugin and open the single.php add the shortcode: <?php the_social_links();?> under line 7 in the single.php file.

<?php 
        while ( have_posts() ) : the_post();
            get_template_part( 'content', 'single' );
            the_social_links();
            dw_minion_content_nav( 'nav-below' );
            dw_minion_related_post($post->ID);
            if ( comments_open() ) comments_template();
        endwhile; 
        ?>

NOTE: If you still face there issue, you can tell me know which plugin are you using. I will check and help you.
Hope this helps !

Profile photo of Yarko GurYarko Gur
answered 2 years ago

noup, its not working, how i’m doing
in function.php i added code

function profit_shortcode1() {
if(is_single()){
$profit_advert = <<<HTML
<<<>>>
HTML;
return $profit_advert;
}
}
add_shortcode( ‘profit1’, ‘profit_shortcode1’ );

after i using shortcode – [social] in single.php under line 7: get_template_part( ‘content’, ‘single’ );
and article stop working 🙁

Profile photo of Yarko Gurwoopygoldberg
replied 2 years ago

function profit_shortcode1() {
if(is_single()){
$profit_advert = <<<HTML
SOCIAL CODE HERE
HTML;
return $profit_advert;
}
}
add_shortcode( ‘profit1’, ‘profit_shortcode1’ );

dominic
replied 2 years ago

Which plugin are you using?

Powered by DW Question & Answer Pro

Access years of experience in WordPress; Collaborate with professionals trusted by tens of thousands of people across the world.

Sign Up Today