Community Forums › Forums › Archived Forums › Design Tips and Tricks › New image sections for Workstation Pro?
Tagged: image areas, workstation pro
- This topic has 3 replies, 3 voices, and was last updated 6 years, 11 months ago by
Adrien Sanborn.
-
AuthorPosts
-
January 16, 2016 at 4:15 pm #176718
customary12
ParticipantCan anyone help add image sections? I've altered the arrays in output.php and customization.php to reflect the new additions, and styled them in css, as well as expanding the front-page.php to include:
$image_section_3 = get_option( '3-workstation-image', sprintf( '%s/images/bg-3.jpg', get_stylesheet_directory_uri() ) );
and
if ( ! empty( $image_section_3 ) ) {
echo '<div class="image-section-3"></div>';
}They don't show up, but I can't see anything else that looks relevant. Thanks.
January 17, 2016 at 5:34 pm #176806Marcy
ParticipantYou said you already did this, but these are the steps to try.
The other thing that could help is to remove the images that are already there in the Customizer, and save it. Then add the images again, and save again. It seems that when changes are made to the code, it doesn't always pick it up, unless the images are added again.
1. style.css near line 1565 add .image-section-3
.image-section-1, .image-section-2, .image-section-3 { background-position: top; background-size: cover; min-height: 500px; }
2. /lib/output.php near line 19, add 3
$opts = apply_filters( 'workstation_images', array( '1', '2', '3' ) );
3. /lib/customize.php near line 37, add 3
$images = apply_filters( 'workstation_images', array( '1', '2', '3' ) );
4. front-page.php, change this:
First change near line 56, add $image_section_3function workstation_front_page_widgets() { $image_section_1 = get_option( '1-workstation-image', sprintf( '%s/images/bg-1.jpg', get_stylesheet_directory_uri() ) ); $image_section_2 = get_option( '2-workstation-image', sprintf( '%s/images/bg-2.jpg', get_stylesheet_directory_uri() ) ); $image_section_3 = get_option( '3-workstation-image', sprintf( '%s/images/bg-3.jpg', get_stylesheet_directory_uri() ) );
Second change, add where you want it to appear - I'm adding between front-page-2 and front-page-3
genesis_widget_area( 'front-page-2', array( 'before' => '<div id="front-page-2" class="front-page-2"><div class="flexible-widgets widget-area wrap' . workstation_widget_area_class( 'front-page-2' ) . '">', 'after' => '</div></div>', ) ); if ( ! empty( $image_section_3 ) ) { echo '<div class="image-section-3"></div>'; } genesis_widget_area( 'front-page-3', array( 'before' => '<div id="front-page-3" class="front-page-3"><div class="flexible-widgets widget-area wrap' . workstation_widget_area_class( 'front-page-3' ) . '">', 'after' => '</div></div>', ) );
Marcy | Amethyst Website Design | Twitter
January 18, 2016 at 5:27 pm #176884Marcy
ParticipantYou also need to edit in the @media sections:
@media only screen and (max-width: 1220px) { .image-section-1, .image-section-2, .image-section-3 { min-height: 400px; } }
@media only screen and (max-width: 880px) { .image-section-1, .image-section-2, .image-section-3 { min-height: 200px; } }
Marcy | Amethyst Website Design | Twitter
April 20, 2016 at 8:17 pm #184033Adrien Sanborn
MemberHey, This is awesome! I was having trouble getting this to work, but all I was missing was adding the '3' to the array in output.php. Thanks Marcy!
I’ve accepted the challenge! I’ll be answering at least 1 unanswered post per week.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.