front-page.php as fast as possible
-
Hi
I am far away from being a developper, so I was wondering if this code is a good way to include html into my front-page.php or if I should use “echo”, or something else better.
This page is quite heavy ( slideshow, images, parallax and animation effects, widget… ) so my worry is to keep things light and fast as much as possible. For exemple, I try to not insert to much widget inside, to use shortcode instead or to write HTML myself. But maybe it is a bad thing !
Thank you to anybody who have something to say about this !
Marion
// Remove the default Genesis loop ans add custom homepage instead remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'one_pager_homepage_content' ); function one_pager_homepage_content() { ?> <!-- Welcome section --> <section id="welcome" class="parallax"> <h2>Bienvenu sur le site d'Alizée Roussel, cavalière de dressage</h2> </section> <!-- Prestation section --> <section id="prestation" class="parallax"> <article class="wrap"> <h3>MES PRESTATIONS</h3> <div class="prestation dressage one-third first"> <div class="photo"><img alt="dressage du cheval" src="https://localhost/wordpress/wp-content/themes/one-pager-genesis-master/images/prestations/dressage.jpg"/></div> <h4>Dressage du cheval</h4> </div> <div class="prestation valorisation one-third"> <div class="photo"><img alt="valorisation en compétition" src="https://localhost/wordpress/wp-content/themes/one-pager-genesis-master/images/prestations/valorisation.jpg"/></div> <h4>Valorisation en compétition</h4> </div> <div class="prestation entrainement one-third"> <div class="photo"><img alt="Entrainement du cavalier" src="https://localhost/wordpress/wp-content/themes/one-pager-genesis-master/images/prestations/entrainement.jpg"/></div> <h4>Entrainement du cavalier</h4> </div> <div class="clear-line"></div> <div class="bouton"> <a href="https://localhost/wordpress/mes-prestations/">En savoir plus</a> </div> </article> </section> <!-- image 1 section --> <section id="image1" class="parallax"></section> <!-- cheval section --> <section id="cheval" class="parallax"> <article class="wrap"> <h3>LES CHEVAUX</h3> <?php echo do_shortcode('[display-posts post_type="cheval" image_size="cheval" posts_per_page="12" wrapper="div"]'); ?> </article> </section> <!-- image 2 section --> <section id="image2" class="parallax"></section> <!-- Album section --> <section id="album" class="parallax"> <article class="wrap"> <div id="photos" class="one-half first"> <a href="https://localhost/wordpress/albumphoto/"> <h3>Albums photos</h3> </a> </div> <div id="videos" class="one-half"> <a href="https://localhost/wordpress/albumvideo/"> <h3>Albums vidéos</h3> </a> </div> </article> </section> <!-- image 3 section --> <section id="image3" class="parallax"></section> <!-- section courante --> <section id="actualite-sidebar" class="parallax"> <article id="actualite" class="wrap two-thirds first genesis-grid"> <?php genesis_widget_area( 'actualite-section', array( 'before' => '<div class="actualite-section widget-area">', 'after' => '</div>', ) ); ?> </article> <sidebar id="sidebar" class="wrap one-third genesis-grid"> <?php genesis_widget_area( 'sidebar-section', array( 'before' => '<div class="sidebar-section widget-area">', 'after' => '</div>', ) ); ?> </sidebar> <div class="clear-line"></div> </section> <!-- Contact section --> <section id="contact" class="parallax"> <article class="wrap"> <?php genesis_widget_area( 'contact-section', array( 'before' => '<div class="contact-section widget-area">', 'after' => '</div>', ) ); ?> </article> </section> <?php }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘front-page.php as fast as possible’ is closed to new replies.