Forum

Can I add a php scr...
 
Notifications
Clear all

Can I add a php script in WordPress

Page 1 / 2
KoiKiwi
(@koikiwi)
Eminent Member

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

Quote
Topic starter Posted : 18/06/2021 8:31 am
Adilkhan
(@adilkhan)
Honorable Member

Did ypu mean how to install and add php script to my main website

ReplyQuote
Posted : 19/06/2021 11:53 am
Hassan Raza
(@hassanraza)
Trusted Member
Posted by: @koikiwi

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

Yes you can.

Follow these steps.

From your WordPress dashboard, navigate to XYZ PHP Code -> PHPCode Snippets.

In the PHP Code Snippets page, click Add New PHP Code Snippet. Add your desired PHP function and its tracking name to the appointed boxes. In this example, we will add the date() function that returns the local date and time. Then, click Create.

 

This image shows you how to add PHP code to the Insert PHP Code Snippet plugin. This plugin will help you add PHP to WordPress post or page.

If the process is successful, a confirmation message and the new function will appear on the screen. For future use, make sure all the PHP functions you want to use are active by checking the Action section. Active code snippets will show a green pause symbol while inactive ones will have a green checkmark next to them.

 

This image shows you how to tell if the added function is active. To deactivate the function, click on the Pause button in the Action section..

To add a PHP code to a WordPress post or page, paste the snippet shortcode of the function you want to use in the desired location. If you’re using the Gutenberg block editor, use the shortcode or code block to display it.

ReplyQuote
Posted : 19/06/2021 1:10 pm
Ihthisham
(@ihthisham-ahmed)
Reputable Member
Posted by: @koikiwi

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

Hello friend, this might be helpful - https://www.codeclouds.com/blog/how-to-insert-custom-php-to-a-wordpress-post/

ReplyQuote
Posted : 19/06/2021 2:21 pm
Muhammad aown
(@muhammad-aown)
Famed Member

Wordpress doesn't directly allow it However you can use some plug-in and then insert php in wordpress.

ReplyQuote
Posted : 20/06/2021 1:14 pm
Ihthisham
(@ihthisham-ahmed)
Reputable Member
Posted by: @muhammad-aown

Wordpress doesn't directly allow it However you can use some plug-in and then insert php in wordpress.

Install and activate the Insert PHP Code Snippet plugin

 

ReplyQuote
Posted : 21/06/2021 3:21 am
Ihthisham
(@ihthisham-ahmed)
Reputable Member
Posted by: @koikiwi

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

Install and activate the Insert PHP Code Snippet plugin

 

ReplyQuote
Posted : 22/06/2021 11:00 am
Adilkhan
(@adilkhan)
Honorable Member

By default, WordPress doesn't allow you to run PHP code in posts or pages. The recommended way to add PHP functions is to modify the child theme or create custom page templates. Despite so, there are occasions where you might want to add specific PHP functions to an individual post or page.

Taken From:Hostinger.com

ReplyQuote
Posted : 24/06/2021 1:06 pm
KoiKiwi
(@koikiwi)
Eminent Member

@muhammad-aown ok thanks for clarification 

ReplyQuote
Topic starter Posted : 24/06/2021 3:30 pm
KoiKiwi
(@koikiwi)
Eminent Member

@ihthisham-ahmed thank you for the advice!

ReplyQuote
Topic starter Posted : 24/06/2021 3:31 pm
Ihthisham
(@ihthisham-ahmed)
Reputable Member
Posted by: @koikiwi

@ihthisham-ahmed thank you for the advice!

You are welcome, friend.

ReplyQuote
Posted : 26/06/2021 6:52 am
batoolabbas
(@batoolabbas)
Reputable Member
Posted by: @koikiwi

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

WordPress doesn’t allow you to run PHP scripts in pages. The recommended way to add is to modify the child theme or create custom page templates. You have to use plugins for that 

There is a full guide on the Hostinger’s website you can follow

https://www.google.com/amp/s/www.hostinger.com/tutorials/wordpress/how-to-add-php-code-to-wordpress-post-or-page/amp

 

 

ReplyQuote
Posted : 08/07/2021 12:19 am
preetchovatiya
(@preetchovatiya)
Estimable Member
Posted by: @koikiwi

Hi everyone just wondering if I can intergrade a PHP script into my WordPress website?

Yes, absolutely. You can add a PHP script inside your WordPress dashboard. You can also do changes in the coding of the theme.

ReplyQuote
Posted : 12/07/2021 3:43 pm
Muhammad aown
(@muhammad-aown)
Famed Member

@adilkhan to his wordpress main blog website.

ReplyQuote
Posted : 15/07/2021 7:42 am
Muhammad aown
(@muhammad-aown)
Famed Member

@preetchovatiya but how? Bro. I want to know about.

ReplyQuote
Posted : 15/07/2021 7:42 am
Page 1 / 2
Share: