Support » Themes and Templates » Shortcode table forced to top of page

  • Resolved Twilkey


    I have created some plugins that use shortcodes. When I place these shortcodes inside a post or a page the tables are forced to the top reguardless of where I put the shortcode. I have tried using clear:both; and position: static; and placing everything in divs. I even tried placing !important in the css, but nothing works. I also switched to multiple themes and even deleted all the css of the theme I use to see if it was the theme that was doing it, and that didnt help.

    Here is the html and css I am using for one of the tables I use.

    [CSS code moderated – please post a link to your site]

    [code above the forum limit of 10 lines moderated – use the pastebin]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hard to tell without a link to your site where this is happening…position can depend on other elements on the page among other things.

    BTW, you say “tables” but there are no actual html tables in your code?? Assuming you mean that figuratively — i.e. your columns/lists look like a table when displayed?

    Sorry, here is a link. The home page has a few tables from different plugins I made that have this issue. And yes I do mean tables figuratively.

    Sorry, but I’m confused about what you are trying to do — where is it that you want those elements?

    On that page, you see the tables, including the exerpt are all above where it says Poker Comparison Guide 2012
    Poker Comparison Guide 2012

    Well in the editor in the admin area that text is above the shortcode. No mater where I put the shortcode inside of the editor, when viewing the page, anything created by the shortcodes get forced to the top.

    This is the html contents of that page.

    Poker Comparison Guide 2012
    [addconversiontable id="1"]
    <h3>Poker Comparison Guide 2012</h3>
    [addconversiontable id="1"]
    [top5table id="1,2,3,4,5"]
    [winning_latestposts include="65"]

    Mmmn, weird. Can’t see anything obvious. What theme is that? Have you tried validating the pages?

    What happens if you just manually add the html code for the shortcoded sections? Do they do the same thing?



    Forum Moderator

    without having seen your shortcode code:

    never use echo but always use return in shortcodes.

    Thanks for the help. My issue was that my html was basically just being echoed, so I did what alchymyth said and returned it and that fixed it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Shortcode table forced to top of page’ is closed to new replies.