WordPress.org

Forums

[resolved] Shortcode table forced to top of page (8 posts)

  1. Twilkey
    Member
    Posted 2 years ago #

    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]

  2. WPyogi
    Forum Moderator
    Posted 2 years ago #

    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?

  3. Twilkey
    Member
    Posted 2 years ago #

    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.
    http://gr88pokerrakeback.com/

  4. WPyogi
    Forum Moderator
    Posted 2 years ago #

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

  5. Twilkey
    Member
    Posted 2 years ago #

    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"]
  6. WPyogi
    Forum Moderator
    Posted 2 years ago #

    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?

  7. without having seen your shortcode code:

    never use echo but always use return in shortcodes.

  8. Twilkey
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic