admin管理员组文章数量:1336568
I know PHP well but I'm new to Wordpress. I got an incomplete Wordpress website. It has a static home page with an Aweber newsletter form. I tried digging into installed theme and in home.php
I came across:
<div class="home-infobox">
<?php if ( is_active_sidebar( 'homepage-infobox' ) ) : ?>
<?php dynamic_sidebar( 'homepage-infobox' ); ?>
<?php endif; ?>
</div>
Now when I view source on the home page, the Aweber newsletter subscription form appears exactly within <div class="home-infobox">
. I have to make changes to the form as my first step and I tried to figure out from where is it fetching the content? Is it from the database or from any PHP files, I am totally clueless.
Please help me figure this out.
I know PHP well but I'm new to Wordpress. I got an incomplete Wordpress website. It has a static home page with an Aweber newsletter form. I tried digging into installed theme and in home.php
I came across:
<div class="home-infobox">
<?php if ( is_active_sidebar( 'homepage-infobox' ) ) : ?>
<?php dynamic_sidebar( 'homepage-infobox' ); ?>
<?php endif; ?>
</div>
Now when I view source on the home page, the Aweber newsletter subscription form appears exactly within <div class="home-infobox">
. I have to make changes to the form as my first step and I tried to figure out from where is it fetching the content? Is it from the database or from any PHP files, I am totally clueless.
Please help me figure this out.
- What changes do you want to make? Are you referring to styling that specific widget or the contents of that widget? – Brad Dalton Commented Jan 13, 2014 at 1:26
- you are saying static home page right ? then you should be checking front-page.php if theme has that file or else index.php – bravokeyl Commented Mar 23, 2015 at 20:22
- oops! it seems to be a old question , i didn't check this. – bravokeyl Commented Mar 23, 2015 at 20:24
4 Answers
Reset to default 2- The contents of
dynamic_sidebar
are pulled from the widgets associated with this "Sidebar" aka "Widget Area" inwp-admin
, as @s_ha_dum answered. There is no template file for the sidebar itself. Visit/wp-admin/widgets.php
underAppearance
->Widgets
and find the widget area titledhomepage-infobox
. You be able to add/remove widgets and possibly make changes to the content here. - Search your plugin and theme files, possibly
functions.php
forregister_sidebar
to find one using the slughomepage-infobox
. The declaration ofregister_sidebar
may include some presentation code.
See also
- https://developer.wordpress/themes/functionality/sidebars/
- https://codex.wordpress/Function_Reference/dynamic_sidebar
You are looking at, as the function name suggests, a dynamic sidebar. Content that fills that sidebar should come from sidebar widgets, some of which are provided by the WordPress core but many (most) are provided by plugins and themes. Widgets could populate themselves from the database, or from external sources like RSS feeds, or may be hard-coded to display static data. It depends on the widget. If you look at the markup inside the sidebar for the individual elements you can usually work out what plugin is creating the widget. Check the CSS class
es and id
s.
It may not be in the database. It's more than likely in a theme based functions file you haven't checked.
You'll want to check the functions.php
of the theme folder. Either that or an includes/theme-init.php
file may have the associated code for your dynamic sidebar.
Another pitfall might be that you doesn't call get_footer()
in the template. That is where the scripts are loaded.
That is easily missed while working on a site where you aren't done with some parts yet.
本文标签: templatesHow to edit contents of dynamicsidebar()
版权声明:本文标题:templates - How to edit contents of dynamic_sidebar()? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742383080a2464482.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论