How to Allow PHP in WordPress Posts and Pages


How to Allow PHP in WordPress Posts and Pages
Stacey Miller

By default, you cannot execute PHP in WordPress posts and pages. We have made it a rule of thumb to never execute PHP in our posts and pages either because it can be hectic to change things in the future. A better practice would be to edit the WordPress theme by creating a custom page template, or single post template. However for some users, it may be necessary to execute PHP in WordPress posts. We couldn’t find a need for it, but apparently over 26,000 people have. So in this article, we will share how to allow PHP in WordPress posts and pages.

WordPress.org
Perla Thorne

Support » Plugin: Allow PHP in Posts and Pages

How to Add PHP Code to WordPress Post or Page
Alberta Phelps

Gediminas is a passionate content writer and SEO geek at Hostinger. He started his journey at customer support and aims to use his gathered knowledge to create the most epic content the world has ever seen. From WordPress to server management, there’s no topic he can’t cover! He also likes cats.

How to Allow PHP in WordPress Posts and Pages ?
Amira Kimmel

Install “Allow PHP in Posts and Pages Plugin” if you have know how about basic html tags you will be able to use it easily because it supports shortcodes.Visit this link for notes about usage of short codes.

рќ–Ћрќ–†рќ–’рќ–—рќ–”рќ–Ќрќ–Ћрќ–™.рќ–Ћрќ–“
Brittany Wells

1. Create your own short code in function.php and call where you want.
2. The quickest and easiest way to do this is to use a plugin from WordPress plugin directory that allows you to run PHP code in post and page content.

(adsbygoogle = window.adsbygoogle || []).push({});

So here we will talk about the second option which is quickest and easiest to use for any newbie WordPress Developer.

Be the first to comment

Leave a Reply

Your email address will not be published.


*