How do I run a PHP script on my WordPress website?

by maxdosh 5 replies
I was looking for a plugin but then figured a php script on codecanyon can do what i want on my WordPress website but then i don't know a thing about php script and how to make it work on my WordPress website. Do i install it or something to have it function like wen i install a plugin in WordPress. Need help thanks
#programming #php #run #script #website #wordpress
Avatar of Unregistered
  • Profile picture of the author Michael Martin
    PHP is not a plugin it is a language and looks like this. sololearn are good to start
    {{ DiscussionBoard.errors[11081965].message }}
    • Profile picture of the author Michael Martin
      <?php

      $keyword_one = $result['keyword_one'];
      $keyword_two = $result['keyword_two'];
      $keyword_three = $result['keyword_three'];
      $keyword_four = $result['keyword_four'];
      $keyword_five = $result['keyword_five'];
      $keyword_multi = $result['keyword_multi'];



      $input = array($keyword_multi);
      $keyword = array_rand($input);

      // echo $input[$keyword]; $keyword_one, $keyword_two, $keyword_three, $keyword_four, $keyword_five
      ?>
      {{ DiscussionBoard.errors[11081966].message }}
  • Profile picture of the author sunoy14
    If you havent worked with programming language like php or havent coded in wordpress, you should probably just get a plugin.

    Otherwise you can add the php script with add_action hooks or add_shortcode inside functions.php. Or you may want to put the code inside a theme template file
    Signature

    "wordpress plugins" & "blogging tutorials" www.rom-link.com
    Free guitar lessons www.mamamusicians.com

    {{ DiscussionBoard.errors[11082017].message }}
  • Profile picture of the author divyakochar
    The php script needs to be executed on the wordpress to work. So either you can add the script to the page where you need it to work but adding any code which you don't have idea about can be harmful. So, you better take a hard look on that code and if that isn't malicious then you can add it to the page where it needs to be executed
    Signature
    {{ DiscussionBoard.errors[11094122].message }}
  • Profile picture of the author PhilHardaker
    Simplest solution:
    Install plugin "insert php" by Will Bontrager software.
    https://wordpress.org/plugins/insert-php/
    {{ DiscussionBoard.errors[11111856].message }}
Avatar of Unregistered

Trending Topics

  • 107 {{ upvoteCount | shortNum }}

    Warriors .... Warriors.... what would you like to LEARN?

    Good Morning awesome Warriors... I'm happy to announce that The Warrior Forum is planning to create our first COURSE. Yes... Powered by Warrior Wisdom... yeah!! Made at home. But before ... [read more]

  • 91 {{ upvoteCount | shortNum }}

    How I Sold 985 Copies of an Affiliate Offer in 5 Days (Step by Step)

    When I first started online in 2002, it took me a year to sell 985 copies of anything. These days, I can typically do it in the span of a ... [read more]

  • 4 {{ upvoteCount | shortNum }}

    Insanely high Avg $/sale, ridiculously low Gravity? (Clickbank Marketplace)

    sprogy in Internet Marketing

    I'm looking at the top Avg $/sale products in the Clickbank Marketplace: And my question is, why are products that (supposedly) bring in so much money per conversion...and surprisingly, some ... [read more]

  • 1 {{ upvoteCount | shortNum }}

    Anybody have Board Commandr/Similar?

    Hi I liked the look of Board Commander, but it's closed to new customers. Does anybody have it ad does it work, first off? Is there an alternative that does ... [read more]

  • 1 {{ upvoteCount | shortNum }}

    Generating Free Traffic - Two-Part Question

    Friends, like many of us I am seeking more, much more, free and organic traffic. Does anyone have experience with 1) Google RLSA Re-marketing List for Search Ads (is this ... [read more]