I know PHP well but I’m new to WordPress. I have an incomplete WordPress website. It has a static home page with an Aweber newsletter form. I tried digging into the installed theme and in home.php and came across:
<div class="home-infobox">
<?php if ( is_active_sidebar( 'homepage-infobox' ) ) : ?>
<?php dynamic_sidebar( 'homepage-infobox' ); ?>
<?php endif; ?>
</div>
When I view the 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.
You can use the following code to get the value instead of printing.
That line:
Is printing out content of homepage-infobox sidebar. Sidebar can contain widgets. You can see (and change) sidebar content under Appearence->Widgets (/wp-admin/widgets.php).
Widgets can be created by some plugin you installed, or you can create one on your own, i.e. from functions.php.
And even if you find out what plugin created the widget and you find actual code that is doing it it’s not good practice to change 3rd party code – with some update your changes can be overwritten.
Open the themes folder (like
'wp-contentthemestwentyeleven'
). You will find a php file namedfunctions.php
. Open it and search forhomepage-infobox
, you will find it inregister_sidebar
.