简体   繁体   中英

how to add html page in wordpress page partially

I am new to wordpress. I want to partially render some html code to wordpress page from admin section.

Description : i have a file menu.php with contains some html elements. Is it possible to inject this file to a page from admin section while editing page information.

Many Thanks.

M

[1] You can simply add html code/elements in the page/post. Have a look to this screenshot: https://www.diigo.com/item/p/rapdderzccaddbecazbecorocb

OR [2] You can create a template as described below : Duplicate post.php or page.php in your theme folder (under /wp-content/themes/themename/).

Rename the new file as templatename.php (where templatename is what you want to call your new template!). Enter the following at the top of the new file:

<?php
/*
Template Name: templatename
*/
?>

You can modify this file (using php) to include other files or whatever you need.

Then create a new page in your WordPress blog, and in the page editing screen you'll see a 'Template' dropdown in the 'Attributes' widget to the right. Select your new template and publish the page.

Your new page will use the php code defined in templatename.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM