admin管理员组文章数量:1295948
i am taking a hard time to figure how to do it. I have three different pages in my wordpress installation besides the Homepage. I need to edit each one of them separately, remove header, footer and do some other stuff. The thing is that i dont know where are those pages source code files in wordpress directory in order to edit them.
i am taking a hard time to figure how to do it. I have three different pages in my wordpress installation besides the Homepage. I need to edit each one of them separately, remove header, footer and do some other stuff. The thing is that i dont know where are those pages source code files in wordpress directory in order to edit them.
Share Improve this question asked Jan 16, 2020 at 14:40 Wanderson GalpãoWanderson Galpão 331 silver badge6 bronze badges4 Answers
Reset to default 1Much of the code for any page, including header and footer, comes from your theme.
If you want to create fully custom code, your best bet is to create a child theme (which just means creating a "style.css" file with some comments that refer to the parent theme, which is what you're currently using) and inside the child theme, create custom templates. It's there where you can add your own HTML and a loop to grab the content for each page (the part you edit in wp-admin).
As mentioned elsewhere here, the display of your posts/pages depends on the theme that you are using. And making changes to the theme's code is not recommended, as any changes will be overwritten with a theme update. That's why you would create and activate a Child Theme to make changes. (Although you can make simple CSS changes via Admin, Themes, Customization, Additional CSS screen.)
But if you really want to know how to change a specific look of a page, without changing the theme, Child Themes is what you want to do. Then you can add your customized page code to modify how things look.
For this, you need to understand how themes work, and how they are 'built'. You should start here: https://developer.wordpress/themes/ . Then, look at 'theme hierarchy' to understand what theme template file is used to 'build' the post/page. There are also manu google/bings/ducks on how to build themes, create Child Themes, and the theme hierarchy.
Rather than editing Wordpress or your theme's source code you're better off using the "Additional CSS" option found while customizing your theme appearance within the admin menu.
Using Google Chrome or similar, load your up page, right click on the header region then select "Inspect". You will see on the left of your screen the CSS styles associated with your page.
In my case the header was called "header-layout-1". Yours might be different.
While editing the "Additional CSS" add the following line;
.header-layout-1 {display:none;}
Save your changes and reload your page. Your header should be gone.
Follow the same steps for the footer or anything else you don't want displayed.
More information from Wordpress
Open up the root directory of your Wordpress folder and then navigate to wp-content/themes/
to see all the installed themes. Select the theme you're using and that folder will contain all theme specific code, including template files.
本文标签: how to edit source code of specific page in wordpress
版权声明:本文标题:how to edit source code of specific page in wordpress? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741627777a2389180.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论