How to add PHP code in WordPress POST without using a plugin
P粉327903045
P粉327903045 2024-02-26 21:37:07
0
1
431

I'm trying to manually add php code (2000 lines) to a WordPress post without using any plugins or 3rd party tools. But I haven't had success with this yet... If anyone knows how I can do this, please feel free to post an answer. So far I have been able to add my php code to the WP Page but not to the WP Post. I'll be looking forward to it! Thanks!

P粉327903045
P粉327903045

reply all(1)
P粉659516906

I could do this by creating a separate .php file in the theme's "twentytwentytwo" folder and pasting the following code into it...

"

  • Template name: New theme

  • Template Post Type: Post */ ? >”

"" ""

By doing this, I create a separate topic for my posts. Then simply pasted my php code below the get_header() line... After that I logged into my WP admin and clicked on edit post and in the template drop down section I found that my theme name "New Theme" was just selected and published. Job done!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!