I want to add Full-width fourth footer widget
-
I want to add Full-width fourth footer widget and I don′t know how can I do it
-
there are already four widget areas in your theme.
do you want to change the layout of the ‘Footer 1’ or ‘Footer 4’ to be full width, or do you want to add a fifth widget area either below or after the existing ones?
in any case, start with creating a child theme; https://codex.www.ads-software.com/Child_Themes
I want to change footer 4 to be full width, do you know how can I do it?
the below should work when you are using all the other three footer widget areas and the fourth footer area.
‘Footer Sidebar 4’ should then be full width./* =Widgets 3 + 1 */ #secondary.widget-areas .widget-area:nth-child(1), #secondary.widget-areas .widget-area:nth-child(2), #secondary.widget-areas .widget-area:nth-child(3) { margin-right: 5%; width: 30%; } #secondary.widget-areas .widget-area:nth-child(3) { margin-right: 0; } @media screen and (max-width: 885px) { #secondary.widget-areas .widget-area:nth-child(1), #secondary.widget-areas .widget-area:nth-child(2), #secondary.widget-areas .widget-area:nth-child(3) { clear: both; width: 100%; margin-right: 0; } } #secondary.widget-areas .widget-area:nth-child(4) { width: 100%; clear: left; }
add it to style.css of a child theme or via a ‘custom CSS’ plugin.
due to the programming structure of the theme, this will not work if you do not use all the ‘Footer Sidebar 1’ and ‘Footer Sidebar 2’ and ‘Footer Sidebar 3’ areas.
roughly tested in various browser sizes in Firefox, but not tested in any actual small devices like mobile phones, etc …
works perfect! thanks a lot
and how can I add more widgets before footer? It′s possible?
generally, review https://codex.www.ads-software.com/Widgetizing_Themes
are you already working with a child theme?
how many widgets or widget areas do you need?
what layout do you want?I am working on a child theme. I want to add some widgets to put ads on my website. Maybe I can put other 4 widgets like the original pictorico theme
to add four more widget areas into the footer above the existing ones, in a child theme:
for example:add to functions.php:
add_action( 'after_setup_theme', 'pictorico_child_setup' ); function pictorico_child_setup() { add_action( 'widgets_init', 'pictorico_child_widgets_init', 9 ); } function pictorico_child_widgets_init() { for ($i = 1; $i <= 4; $i++) { //register four new widget areas in the footer// register_sidebar( array( 'name' => 'Footer Sidebar Top '.$i, 'id' => 'top-'.$i, 'description' => 'Top of Footer Widget Area '.$i, 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); } }
add to footer.php, after this line
</div><!-- #content -->
:<?php get_sidebar( 'footer-top' ); //calls new footer sidebar // ?>
and create a new sidebar-footer-top.php, with this code:
<?php /** * The Sidebar containing the top footer widget areas. * * @package Pictorico child */ ?> <?php if ( is_active_sidebar( 'top-1' ) || is_active_sidebar( 'top-2' ) || is_active_sidebar( 'top-3' ) || is_active_sidebar( 'top-4' ) ) : ?> <div id="tertiary" class="widget-areas" role="complementary"> <div class="widget-areas-inner"> <?php if ( is_active_sidebar( 'top-1' ) ) : ?> <div class="widget-area"> <?php dynamic_sidebar( 'top-1' ); ?> </div> <?php endif; ?> <?php if ( is_active_sidebar( 'top-2' ) ) : ?> <div class="widget-area"> <?php dynamic_sidebar( 'top-2' ); ?> </div> <?php endif; ?> <?php if ( is_active_sidebar( 'top-3' ) ) : ?> <div class="widget-area"> <?php dynamic_sidebar( 'top-3' ); ?> </div> <?php endif; ?> <?php if ( is_active_sidebar( 'top-4' ) ) : ?> <div class="widget-area"> <?php dynamic_sidebar( 'top-4' ); ?> </div> <?php endif; ?> </div> </div><!-- #tertiary --> <?php endif; ?>
I ve made my child theme with a plug in (child theme wizard) and only have style.css and functions.php. Is ok or I must make other child theme manually?
you need to find a way to create the other required files in the child theme;
possibly using FTP https://codex.www.ads-software.com/FTP_Clientsif this is not possible with a child theme made with your used plugin, then you will need to create a child theme manually.
maybe ask in the plugin’s forum https://www.ads-software.com/support/plugin/child-theme-wizard
is ok if I copy the files I need by FTP from the theme to my child theme or not?
yes, that is ok.
only exemption: do not copy the full functions.php from the parent theme into the child theme.
functions.php and style.css I will not copy, are generated by the plugin (child theme wizard) and then I will add the commands you wrote
did not work, my pictorico child theme is called infoliga, maybe I must change something?
maybe I must change all pictorico_child for infoliga?
- The topic ‘I want to add Full-width fourth footer widget’ is closed to new replies.