Support » Theme: Twenty Sixteen » Remove Solutions section from Home Page

  • Resolved rthorntn

    (@rthorntn)


    Hi,

    Sorry to bother you all, I’m new to WP.

    I can see and edit the section text under:

    Pages – Home – Content 2

    I can remove all of the text and I get a blank space, how do I remove the blank space?

    I tried removing Content 2 from the Field Group but that didn’t work.

    From my searches I’m starting to think that the “Home Page” template is maybe what I need to edit?

    It’s all a bit confusing, when I edit the home page I can’t see the 5 services images, it’s somehow building that from the services page?

    Come to think of it, I might want to remove “About Us”, “Our Service” and “Solutions” from the home page.

    Thanks.
    Richard

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi Richard, do you have a screenshot showing the area you’re referring to in relation to Pages – Home – Content 2?

    You can use https://snipboard.io to upload the screenshot and then paste the link they give to you in your reply here. I’m not quite sure which area you’re referring to on the theme.

    Also, looking at the homepage of your linked domain right now, I don’t see any blank areas so maybe you undid that change?

    Thanks @jarretc

    I think I undid the change.

    It’s this section:

    https://snipboard.io/GNP5R1.jpg

    I just want that Solutions section completely gone.

    And how is WP creating the Our Service section? The code is only:

    <h2 class=”aligncenter border-btm2″>Our Service</h2>
    <h5 class=”aligncenter”>We offer a range of services to meet the needs and demands of our clients while focusing on five core areas.</h5>

    But it’s showing images and text from the services page:

    Design and Implementation
    Security Consulting
    Managed Security Solution Provider
    Security Testing
    Sales as a Service

    As I mentioned, I might want to simplify the home page by completely removing “About Us”, “Our Service” and “Solutions” sections from the home page. Leaving just the DNA image and the text:

    “Evolved Security
    the natural selection for cyber security
    Read More”

    Cheers
    Richard

    It all seems to be stashed in home.php, is it best to rip the content_2 bit out of this template, is that the best practice, if so, how do I take it out cleanly? Thanks everyone.

    <?php
    /**
     * The template for displaying pages
     * Template Name: Home Page
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages and that
     * other "pages" on your WordPress site will use a different template.
     *
     * @package WordPress
     * @subpackage Twenty_Sixteen
     * @since Twenty Sixteen 1.0
     */
    $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    get_header(); ?>
    <header>
    <div class="wrapper">
    <div id="logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php dynamic_sidebar( 'logo' ); ?></a></div>
    <div id="navigation"><div id="navbtn">menu</div><?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu',) ); ?></div>
    </div>
    </header>
    <div id="banner">
    <?php
    if($feat_image != "")
    {
    ?>
    <img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>">
    <?php
    }
    else
    {
    ?>
    <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/slider1.jpg" alt="<?php the_title(); ?>">
    <?php
    }
    ?>
    <div class="banner-text">
    <div>
    <?php if( get_field('banner_text') ): ?>
    <?php the_field('banner_text'); ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    <div id="content">
    <div class="wrapper">
    		<?php
    		// Start the loop.
    		while ( have_posts() ) :
    			the_post();
    			the_content();
    			// End of the loop.
    		endwhile;
    		?>
    </div>
    
    <div class="green-sec">
    <div class="wrapper">
    <?php if( get_field('content_1') ) { $myvalue1 = get_field( "content_1" );  ?><?php echo do_shortcode($myvalue1);  ?><?php } ?> 
    <div class="service-sec">
    
    <?php
    global $paged;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $curpage = $paged ? $paged : 1;
    $args = array('post_type' => 'services', 'posts_per_page' => 5, 'order' => 'desc',  'paged' => $paged);
    $the_query = new WP_Query( $args ); ?>
    <?php if ( $the_query->have_posts() ) : ?>
      <?php while ( $the_query->have_posts() ) : $the_query->the_post(); 
       $postid = $the_query->post->ID;
       $feat_image = wp_get_attachment_url( get_post_thumbnail_id($postid) );
      ?> 
      
    
    <div class="service-box">
    <img src="<?php the_field('second_image'); ?>" alt="">
    <h5><?php the_title(); ?></h5>
    </div>
      
      
      <?php endwhile; ?>  
      <!-- end of the loop -->
      <?php wp_reset_postdata(); ?>
    <?php else:  ?>
    <div class="service-box"><?php _e( 'Sorry, no Service' ); ?></div>
    <?php endif; ?>
    </div>
    </div>
    </div>
    <?php if( get_field('content_2') ) { $myvalue2 = get_field( "content_2" );  ?>
    <div class="wrapper"><?php echo do_shortcode($myvalue2);  ?></div>
    <?php } ?> 
    </div>
    <?php get_footer(); ?>
    • This reply was modified 2 weeks, 5 days ago by rthorntn.

    There isn’t a home.php file in Twenty Sixteen as you can see from the svn directory here:

    https://themes.svn.wordpress.org/twentysixteen/2.0/

    So I assume that somebody added that in for you as a custom setup. As far as taking out the content_2 part, you would remove this from your home.php

    <?php if( get_field('content_2') ) { $myvalue2 = get_field( "content_2" );  ?>
    <div class="wrapper"><?php echo do_shortcode($myvalue2);  ?></div>
    <?php } ?>

    Perfect @jarretc thanks again!

    Yes that page must have been added for us.

    I removed the content_2 code, I can still see some whitespace.

    Which code would I remove to get rid of the content_1 section (services posts), that code is a bit trickier, is there an easy way to figure out where you should start and end the cutting out of the text?

    The services posts section is a bit larger yes. You would remove the following code

    <div class="green-sec">
    <div class="wrapper">
    <?php if( get_field('content_1') ) { $myvalue1 = get_field( "content_1" );  ?><?php echo do_shortcode($myvalue1);  ?><?php } ?> 
    <div class="service-sec">
    
    <?php
    global $paged;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $curpage = $paged ? $paged : 1;
    $args = array('post_type' => 'services', 'posts_per_page' => 5, 'order' => 'desc',  'paged' => $paged);
    $the_query = new WP_Query( $args ); ?>
    <?php if ( $the_query->have_posts() ) : ?>
      <?php while ( $the_query->have_posts() ) : $the_query->the_post(); 
       $postid = $the_query->post->ID;
       $feat_image = wp_get_attachment_url( get_post_thumbnail_id($postid) );
      ?> 
      
    
    <div class="service-box">
    <img src="<?php the_field('second_image'); ?>" alt="">
    <h5><?php the_title(); ?></h5>
    </div>
      
      
      <?php endwhile; ?>  
      <!-- end of the loop -->
      <?php wp_reset_postdata(); ?>
    <?php else:  ?>
    <div class="service-box"><?php _e( 'Sorry, no Service' ); ?></div>
    <?php endif; ?>
    </div>
    </div>
    </div>

    Or when both of the content sections are removed, the code of your home.php should look like this

    <?php
    /**
     * The template for displaying pages
     * Template Name: Home Page
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages and that
     * other "pages" on your WordPress site will use a different template.
     *
     * @package WordPress
     * @subpackage Twenty_Sixteen
     * @since Twenty Sixteen 1.0
     */
    $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    get_header(); ?>
    <header>
    <div class="wrapper">
    <div id="logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php dynamic_sidebar( 'logo' ); ?></a></div>
    <div id="navigation"><div id="navbtn">menu</div><?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu',) ); ?></div>
    </div>
    </header>
    <div id="banner">
    <?php
    if($feat_image != "")
    {
    ?>
    <img src="<?php echo $feat_image; ?>" alt="<?php the_title(); ?>">
    <?php
    }
    else
    {
    ?>
    <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/slider1.jpg" alt="<?php the_title(); ?>">
    <?php
    }
    ?>
    <div class="banner-text">
    <div>
    <?php if( get_field('banner_text') ): ?>
    <?php the_field('banner_text'); ?>
    <?php endif; ?>
    </div>
    </div>
    </div>
    <div id="content">
    <div class="wrapper">
    		<?php
    		// Start the loop.
    		while ( have_posts() ) :
    			the_post();
    			the_content();
    			// End of the loop.
    		endwhile;
    		?>
    </div>
    
    </div>
    <?php get_footer(); ?>

    Thank you, thank you, thanks you @jarretc

    I’m starting to understand it, the php templates add infinite customisation to the pages, that’s why you need developers!

    Is there a plugin that allows me to tweak things so I can avoid code, on my home page I have started an “Our Portfolio” section but I would like it to look like the green bordered services section with the images next to each other, do I need to edit the php for that?

    <h2 style="text-align: center;">Our Portfolio</h2>
    <p style="text-align: center;">We offer a range of products and services to meet the needs and demands of our clients.</p>
    &nbsp;
    
    [caption id="attachment_7" align="alignnone" width="300"]<img class="wp-image-7 size-medium" src="https://www.staging.evolvedsecurity.com.au/wp-content/uploads/2019/10/img1-300x252.jpg" alt="" width="300" height="252" /> Solutions[/caption]
    
    [caption id="attachment_42" align="alignnone" width="228"]<img class="wp-image-42 size-full" src="https://www.staging.evolvedsecurity.com.au/wp-content/uploads/2019/11/img3.jpg" alt="" width="228" height="286" /> Services[/caption]
    
    [caption id="attachment_64" align="alignnone" width="300"]<img class="size-medium wp-image-64" src="https://www.staging.evolvedsecurity.com.au/wp-content/uploads/2019/11/img10-300x220.jpg" alt="" width="300" height="220" /> Products[/caption]

    I’m guessing the green background and the three images side to side is coming from the php below but how to make it apply to the body code above?

    <div class="green-sec">
    <div class="wrapper">

    There are quite a few page builder plugins out there that allow you to design a site without needing to know how to code

    https://wordpress.org/plugins/search/page+builder/

    However, the default editor (assuming you are using a recent version of WordPress and don’t have the Classic Editor plugin installed) should allow you to achieve what you want with some configuring.

    If you have the ability to add blocks, you could start off with a Group block. Then inside of the Group block you can add a Heading block.

    From there, set a Columns block 3 columns wide. In each of those columns you can set an Image block with the appropriate image. Then a Paragraph block under that image for the image “caption”

    All of that may sound really confusing though reading it back over. More information on the Block editing interface is here:

    WordPress Editor

    Wow, thanks again @jarretc the Classic Editor was enabled, I disabled it and now I have blocks, I think I have done what you suggested. Looks great!

    Is there an easy way to change the background colour?

    Cheers
    Richard

    Click on the Group block in the editing screen, on the right hand side of the window there should be an option to set the background color.

    If you don’t see this when clicking on the Group block, click on the Group block and make sure Block is active at the top of the right “sidebar” and it should show up there.

    Thanks @jarretc in the editor I can see the colour change but when I update it isn’t reflected on the home page, something must be overriding it.

    Hmm that is odd, are you able to provide a screenshot of the editor?

    As far as my tests go locally it should work, however if it doesn’t end up working we can most likely get it targeted with some CSS. If you picked a custom color, what is the hex code for the color you picked?

    It should show up when selecting the custom color option at the bottom of the popup and begins with a # and 6 numbers/letters after the pound sign.

    @jarretc Thanks, I’m going to pick my battles on this one because I quite like white now 🙂

    No problem! 🙂

    @jarretc you’re the best, marking as resolved.

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.