Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
CreatiqueMediaParticipant
The problem I have now is for content to display when I add widget content to the widgets themselves. For instance, when I add an image to the Front Page 1 section, it does not display on the frontpage.
I am assuming I need to somehow tell WordPress to activate these widget areas, but I am not aware of how to do that.
Any help here would be great!
Thanks
CreatiqueMediaParticipantOkay, after more research, I discovered that I needed to create a front-page.php file and I added the following PHP code to it:
/** * Adds markup for front page widget areas. * * @since 1.0.0 */ function freelancer_pro_front_page_widgets() { echo '<h2 class="screen-reader-text">' . esc_html__( 'Main Content', 'freelancer-pro' ) . '</h2>'; genesis_widget_area( 'front-page-1', [ 'before' => '<div id="front-page-1" class="front-page-1" tabindex="-1"><div class="image-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-1' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-2', [ 'before' => '<div id="front-page-2" class="front-page-2" tabindex="-1"><div class="solid-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-2' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-3', [ 'before' => '<div id="front-page-3" class="front-page-3" tabindex="-1"><div class="image-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-3' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-4', [ 'before' => '<div id="front-page-4" class="front-page-4" tabindex="-1"><div class="solid-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-4' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-5', [ 'before' => '<div id="front-page-5" class="front-page-5" tabindex="-1"><div class="image-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-5' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-6', [ 'before' => '<div id="front-page-6" class="front-page-6" tabindex="-1"><div class="solid-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-6' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); genesis_widget_area( 'front-page-7', [ 'before' => '<div id="front-page-7" class="front-page-7" tabindex="-1"><div class="image-section"><div class="flexible-widgets widget-area' . freelancer_pro_widget_area_class( 'front-page-7' ) . '"><div class="wrap">', 'after' => '</div></div></div></div>', ] ); }
I then added the following to my functions.php file to register the aforementioned frontpage widget sections:
genesis_register_sidebar( array( 'id' => 'front-page-1', 'name' => __( 'Front Page 1', 'freelancer-pro' ), 'description' => __( 'This is the front page 1 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-2', 'name' => __( 'Front Page 2', 'freelancer-pro' ), 'description' => __( 'This is the front page 2 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-3', 'name' => __( 'Front Page 3', 'freelancer-pro' ), 'description' => __( 'This is the front page 3 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-4', 'name' => __( 'Front Page 4', 'freelancer-pro' ), 'description' => __( 'This is the front page 4 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-5', 'name' => __( 'Front Page 5', 'freelancer-pro' ), 'description' => __( 'This is the front page 5 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-6', 'name' => __( 'Front Page 6', 'freelancer-pro' ), 'description' => __( 'This is the front page 6 section.', 'freelancer-pro' ), ) ); genesis_register_sidebar( array( 'id' => 'front-page-7', 'name' => __( 'Front Page 7', 'freelancer-pro' ), 'description' => __( 'This is the front page 7 section.', 'freelancer-pro' ), ) );
I think this is what I was looking for so far.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)