search
Log In
Welcome to Blogiestools Ask, a blogging community where beginner and professional bloggers come to seek answers from other bloggers’ experiences.

You can ask questions related to starting a blog, monetizing a blog, marketing a blog, managing a blog, fixing a problem, the best web tech tools to use, etc.

Register or log in to ask or answer questions.

Ask a Question

0 votes
I want to run a custom Php script in WordPress posts and pages. Is it possible to do so without using the functions.php file?
in WordPress Problems

1 Answer

0 votes

It is possible to run a custom PHP script or function in WordPress posts and pages. The best approach is to use a PHP code inserter plugin. There are several plugins available for free at the WordPress repository that you can use to insert PHP scripts, but we prefer Insert PHP Code Snippet by xyzscripts because it is lightweight. 

Solution Steps

  • Go to tour WordPress dashboard under plugins and click add new plugin
  • Install and activate a plugin developed by xyzscripts called Insert PHP Code Snippet
  • Create code by adding your custom code to the form
  • Once you have created code a shortcode will be generated
  • Add the shortcode to your pages or posts and click update or publish.
  • The script will be executed  

Another alternative of PHP code inserter plugin is Woody code snippets.

15.4k points

Related questions

0 votes
1 answer
I have several posts on my WordPress site but I want to add CSS to a specific post, how do I do
asked Nov 3, 2021 in WordPress Problems anonymous
0 votes
1 answer
I am looking for ways to disable lazy load in a specific image in visual composer
asked Nov 4, 2021 in WordPress Problems anonymous
0 votes
1 answer
I have tried to import a file in WorPress and I got this error Sorry, there has been an error. The uploaded file exceeds the upload_max_filesize directive in php.ini. How do I fix it
asked Nov 15, 2021 in Fixing Blog Problems anonymous
0 votes
1 answer
I need to migrate my WordPress blog without installing backup plugins
asked Nov 15, 2021 in WordPress Problems anonymous
0 votes
1 answer
I want users to login to my WordPress.org site using their Jetpack via WordPresss.com for security reasons
asked Nov 8, 2021 in WordPress Problems anonymous