WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP in the loop (7 posts)

  1. mtayla
    Member
    Posted 7 years ago #

    I know that I have seen a plugin somewhere that will allow someone to use php in the loop, but I can't find it anywhere now... A search on wordpress forums turned up everything bout php and the loop but this....

    Does anyone know how this is done, or what plugin I need? Thanks.

  2. Chris_K
    Member
    Posted 7 years ago #

    well, The_Loop is running in a php page... so most folks just edit the page with the Loop (like, your theme's index for instance) and add their code.

    What exactly is it that you'd like to do?

  3. Michael Bishop

    Posted 7 years ago #

    You can add any php you want in the loop, are you refering to actually pasting php in a post?

  4. mtayla
    Member
    Posted 7 years ago #

    I should of clarrified more. I a trying to put some code that would normally go in the sidebar, to include data from plugins such as "Latest From Each Category", "BDP Referral Tracker", & "Naatan.com MyStats" among others. All of this would go into one comprehensive "stats" page with both data comming from tmplate tags n the loop and "external" php.

    An example of what I am trying to pass would be:

    <?php echo dd_last_from_each(); ?>
    -or-
    <?php naatan_mystats(); ?>

  5. moshu
    Member
    Posted 7 years ago #

    If it is going on a Page why on the earth do you need the Loop?
    Just create a Page template for it, add all your fancy code, then make a new Page using that template and you are done.

    I don't see where is the problem.

  6. mtayla
    Member
    Posted 7 years ago #

    Somethings plugins need the loop to display their reports, unless you know something I don't. It seems like a bigger pain in the ass to make multiple loops to have everything organized, but shit dude, sorry I bothered you.

  7. mtayla
    Member
    Posted 7 years ago #

    Found it. "WordPress PHP Exec Plugin, This plugin lets you execute dynamic PHP code in posts. It masks PHP code before balanceTags, and unmask them afterwards, so it should be safe to use PHP code that has literal HTML tags in it, for example: code which print out HTML."

    http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

Topic Closed

This topic has been closed to new replies.

About this Topic