WordPress.org

Forums

PHP Code for posts
[resolved] [closed] How to add php code? (7 posts)

  1. taobo
    Member
    Posted 1 year ago #

    How to add php code in post after creating a snippet?

    The shortcode is [php snippet=1]

    And I indeed add <?php before php code

    But I don't know how to insert it into post.

    I have tried [php], [php snippet=1], [php][/php], and [php snippet=1][/php]. But none of them works.

    Please help!

    http://wordpress.org/plugins/php-code-for-posts/

  2. The.Missing.Code
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Taobo,

    If you see the shortcode outputted instead of the php code, it is likely the location does not support shortcodes in your theme. do other shortcodes work in the same location?

  3. taobo
    Member
    Posted 1 year ago #

    All shortcodes do not work in the same location.
    Thank you for your nice reply! :)

  4. The.Missing.Code
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Taobo,

    all you need to do is enable shortcodes in the theme location.

    Take a look at this for more info: http://codex.wordpress.org/Function_Reference/do_shortcode

    Thanks,
    TMC

  5. Vinicius Roggerio da Rocha
    Member
    Posted 1 year ago #

    I'm using SyntaxHighlighter too, and its shortcodes are working fine. But the shortcodes [php snippet=1][/php] don't (simply doesn't appear, even a echo "Hello World"). There's a conflict between these plugins? How to solve this?

  6. The.Missing.Code
    Member
    Plugin Author

    Posted 1 year ago #

    it is possible for it to conflict if the syntax highlighter uses the [php] shortcode too.

    At this time there is not an alternative shortcode for use, however in the future there may be an option for using an alternative shortcode, should there be sufficient demand :)

    TMC

  7. peaceparadise
    Member
    Posted 1 year ago #

    i put a paypal button form <form action="https://www.paypal.com/cgi-bin/webscr" method="post">....</form> in the 'Save code' section of the plugin and pasted the shortcode to a WP page. On viewing the page is blank (no button).

    am I using the right plugin?
    if so, how to fix
    the goal is to have this paypal button form connect to my idevaffiliate software to keep track of affiliate purchases.

    thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PHP Code for posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.