0

using a combo of shortcodes-ultimate, jetpack, and my very own first shortcode, i (almost) have a nice tabbed widget with latest posts, popular pages and comments.

screenshot of content outside the tabbed area

except the comments_list shortcode i created is showing up above the tabbed box. is this too complicated? i think i have everything nested correctly:

    [su_tabs]
    [su_tab title="Popular" disabled="no" anchor="" url="" target="blank" class=""][jetpack_top_posts_widget][/su_tab]
    [su_tab title="Latest" disabled="no" anchor="yes" url="" target="blank" class=""]<h3>Latest Posts</h3>[su_posts template="templates/list-loop.php" posts_per_page="5" tax_term="1,23,24,25,2,20,26,28,35" order="desc" orderby="asc"][/su_tab]
    [su_tab title="Comments" disabled="no" anchor="" url="" target="blank" class=""][comment_list]
    [/su_tab]
    [/su_tabs]

it's totally probabaly i did something wrong in my shortcode, but can't tell what.

2
  • 1
    You should include your code in your question and not link to it. Make sure you return the html code from the shortcode and not echo it. Commented Mar 3, 2018 at 20:15
  • thank you. sorry, new here. and YES using return instead of echo was the fix. thank you. Commented Mar 3, 2018 at 20:19

1 Answer 1

0

Shortcodes are not a programing language, and anything that looks like something a non technical person will not be able to maintain, should never be created/used.

Create one shortcode that does what you need. Since in any case a programmer will be needed to manipulate what you are showing in the question, it can be as well written in PHP and avoid the possibility of it changing without the authors ability to repair by mistake.

Not the answer you're looking for? Browse other questions tagged or ask your own question.