WordPress.org

Ready to get started?Download WordPress

Forums

Insert PHP
How to get Two rows in line? (7 posts)

  1. phattrance
    Member
    Posted 5 months ago #

    Im trying to get two php codes on the same line like this: http://imgur.com/ylrpD5c

    but when i use this plugin it looks like this: http://imgur.com/SipEo9P

    How can i get the two rows to be in the same line as the first screenshot?

    the code im using is:

    [insert_php] if(function_exists('tptn_show_pop_posts')) tptn_show_pop_posts(); [/insert_php]  
    
    [insert_php] if(function_exists('tptn_show_daily_pop_posts')) tptn_show_daily_pop_posts(); [/insert_php]

    URL to the page: http://gifs-gif.com/popular-gifs/

    https://wordpress.org/plugins/insert-php/

  2. WillBontrager
    Member
    Plugin Author

    Posted 5 months ago #

    phattrance, this is a PHP/layout question rather than a question related to the function of Insert PHP.

    To get you started, you might try putting the two sets of PHP code into a table, something like this:

    <table>
    <tr>
    <td valign="top">
    [insert_php] if(function_exists('tptn_show_pop_posts')) tptn_show_pop_posts(); [/insert_php]
    <td>
    <td valign="top">
    [insert_php] if(function_exists('tptn_show_daily_pop_posts')) tptn_show_daily_pop_posts(); [/insert_php]
    </td>
    </tr>
    </table>

    Putting the PHP code into floating divs instead of into a table might also work.

    Will

  3. phattrance
    Member
    Posted 5 months ago #

    thank you, that worked.

    i was wondering if its possible to get some space between those two lines. is that possible?

  4. WillBontrager
    Member
    Plugin Author

    Posted 5 months ago #

    Yes, it's possible.

    Here's documentation for tables:

    http://www.w3schools.com/tags/tag_table.asp

    The same site has documentation for CSS, in case you want to add padding instead of a separate blank column.

    Will

  5. phattrance
    Member
    Posted 5 months ago #

    Thank you, ive checked that page but unfortunately i couldnt find any solution for this (im really bad at css) :)

    Is there any simple way to get more space between these two lines / tables by just adding some code?

  6. WillBontrager
    Member
    Plugin Author

    Posted 5 months ago #

    Try <td valign="top" style="padding-right:100px;"> at the first column. Adjust the number of pixels to adjust the space.

    I realize sometimes a project is such a rush that the time to learn new things seems to be unavailable. It's prudent, however, to learn what you need to know as soon as you have the time. If you'll be developing for web pages, being comfortable with CSS is a great big must.

    Will

  7. phattrance
    Member
    Posted 5 months ago #

    Thank you for you reply, i tested the code but it seems to only move one of the columns (the right one), while the other one on the left is still at the same place.

    is there a way to move the left column a little bit to the left?

    Once again, thank you for all the help!

    The code im using:

    <table>
    <tr>
    <td valign="top"></td><td valign="top" style="padding-right:50px;">
    [insert_php] if(function_exists('tptn_show_pop_posts')) tptn_show_pop_posts(); [/insert_php]
    </td><td>
    </td><td valign="top">
    [insert_php] if(function_exists('tptn_show_daily_pop_posts')) tptn_show_daily_pop_posts(); [/insert_php]
    </td>
    </tr>
    </table>

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.