Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #522620

    We have to hard code the avia divs in the shortcode, but it when we render the page the divs are being duplicated. Do you know what we may have missed.

    <div class=”flex_column av_one_fifth avia-builder-el-0 el_before_av_three_fifth avia-builder-el-first”>
    <div class=”flex_column av_three_fifth avia-builder-el-2 el_after_av_one_fifth el_before_av_one_fifth “>
    <div class=”flex_column av_one_fifth first avia-builder-el-0 el_before_av_three_fifth avia-builder-el-first “>
    <div class=”flex_column av_three_fifth avia-builder-el-2 el_after_av_one_fifth el_before_av_one_fifth “>
    <div class=”flex_column av_one_fifth avia-builder-el-4 el_after_av_three_fifth avia-builder-el-last “>

    Thank you.

    #522636

    Hey!

    If this is the exact code you are using, you are hardcoding builder element ID’s and not closing DIV tags.
    Can you please elaborate on the changes you would like to make? We may be able to provide you an alternative solution.

    Regards,
    Yigit

    #525095

    We have some simple custom shortcodes that we are trying to use to display post information based on the selected category. The data from these shortcodes is what it should be. However, if we leave the hard-coded divs out, the template seems to ignore that the shortcodes are in different text blocks and displays the data together. Only by hard-coding the divs are we able to get the shortcode data to look like we want. Unfortunately, any other items in the same text block as the shortcode gets placed into a different div and displays under the data from the shortcodes.

    As an example, take a look at the current Duexis page in the WordPress Admin. This has test copy above the shortcodes. Since the divs are hard-coded, five divs get generated for the content. Two for the shortcodes and three for the test copy and the widget. If I remove the hard-coded divs from these shortcode functions, three divs will get generated, however the shortcode will display above these divs and not inside like we want.

    It looks like using custom shortcodes is not working nicely with the template text block divs that get generated. Does custom shortcode coding need to be done different that what we are doing? I first had the coding in the child functions.php and then moved them to the shortcodes folder as a stand-alone custom.php file.

    • This reply was modified 9 years, 2 months ago by endoradigital.
    #525828

    I was able to have some success by re-coding the shortcodes. Instead of using the php echo, I saved all output to a variable and then returned the variable. Doing it this way I no longer have to hard-code the divs inside the shortcodes and no extra divs are generated.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Custom Shortcode’ is closed to new replies.