Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1415140
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionI am using a Wordpress theme called "business-one-page", here is a link to the demo of the theme: Buisness-One-Page. I am trying to change the structure of the sections. This is a one page theme so what i want to do is re-order the sections and make for example about section display after the service section.
I am using a child theme and have been trying to locate the .php file that has the structure to copy and change into my child theme directory, but can´t find it. Is it possible to do this ?
Thanks in Advance
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionI am using a Wordpress theme called "business-one-page", here is a link to the demo of the theme: Buisness-One-Page. I am trying to change the structure of the sections. This is a one page theme so what i want to do is re-order the sections and make for example about section display after the service section.
I am using a child theme and have been trying to locate the .php file that has the structure to copy and change into my child theme directory, but can´t find it. Is it possible to do this ?
Thanks in Advance
Share Improve this question asked Aug 21, 2019 at 10:45 davidhlynsdavidhlyns 178 bronze badges 01 Answer
Reset to default 1I'm looking at the free version. The relevant code is in inc/extras.php, and it looks like there are filters to enable / disable sections (business_one_page_ed_<section>_section) and to change the titles of sections (business_one_page_<section>_section_menu_title), but not reorder them:
function business_one_page_get_sections(){
$sections = array( 'about', 'services', 'cta1', 'portfolio', 'team', 'clients', 'blog',
'testimonial', 'cta2', 'contact' );
$enabled_section = array();
foreach ( $sections as $section ){
if ( esc_attr( get_theme_mod( 'business_one_page_ed_' . $section . '_section' ) ) == 1 ){
$enabled_section[] = array(
'id' => $section,
'menu_text' => esc_attr( get_theme_mod( 'business_one_page_' . $section .
'_section_menu_title','' ) ),
);
}
}
return $enabled_section;
}
To let you reorder the sections they'd have to filter $sections before processing them or filter $enabled_section before it's returned. Nor is this function pluggable i.e. you can't just overwrite it wholesale (without monkey patching tricks)
So you're going to have to edit the theme, and either
- change the order here
- add a filter either to the original value of $sections or to $enabled_section so you can edit the order in your filter, and then hook that filter in your child theme
However either will be lost if you update the theme. If you've paid for the theme, or even if you haven't, it might be worth asking Rara Theme if they can add a filter or customisation option here for you for future versions.
本文标签: phpHow to change the structureorder of sections in a Wordpress theme
版权声明:本文标题:php - How to change the structureorder of sections in a Wordpress theme? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745228276a2648710.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论