Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   How do I run a PHP script on my WordPress website? (https://www.warriorforum.com/programming/1271048-how-do-i-run-php-script-my-wordpress-website.html)

maxdosh 30th April 2017 03:57 PM

How do I run a PHP script on my WordPress website?
 
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

Michael Martin 1st May 2017 05:22 PM

RE: How do I run a PHP script on my WordPress website?
 
PHP is not a plugin it is a language and looks like this. sololearn are good to start

Michael Martin 1st May 2017 05:23 PM

RE: How do I run a PHP script on my WordPress website?
 
<?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
?>

sunoy14 1st May 2017 06:53 PM

Re: How do I run a PHP script on my WordPress website?
 
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

divyakochar 16th May 2017 03:40 AM

RE: How do I run a PHP script on my WordPress website?
 
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

PhilHardaker 6th June 2017 02:34 AM

RE: How do I run a PHP script on my WordPress website?
 
Simplest solution:
Install plugin "insert php" by Will Bontrager software.
https://wordpress.org/plugins/insert-php/


All times are GMT -6. The time now is 05:11 PM.