• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to duplicate my homepage for A/B testing

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to duplicate my homepage for A/B testing

This topic is: not resolved

Tagged: a/b test, duplicate, frontpage, homepage

  • This topic has 2 replies, 2 voices, and was last updated 9 years, 5 months ago by iamzeus.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 27, 2016 at 10:46 am #177671
    iamzeus
    Member

    Good day

    I have some internal pages lets say:

      http://www.example.com/home2
      http://www.example.com/home3

    I want to do some A/B testing between my homepage and the home2 & home3 pages by just modding some CSS things using Custom Post Classes for each one.

    How can I duplicate my homepage into home2 & home3?

    January 27, 2016 at 1:04 pm #177678
    Cathy @ WPBarista
    Member

    To duplicate the home page, I would simply copy the front_page code to the functions file, and add a conditional for the page ID's of home2 and home3. You will automatically have body classes that are different and can make your css changes by targeting those. Will that work?


    Visit WP Barista to download 52 Quick Edits You Can do Today to Get More Clicks / Views / Sales. I also do paid support (starting at $75) and fully custom Genesis Child Themes.
    January 28, 2016 at 1:31 pm #177762
    iamzeus
    Member

    Im not that tech savy into wordpress, but i see my child theme has a home.php with this code:

        <?php
        # Force full width content
        add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
        # Remove the breadcrumb
        remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
        //* Display Categories
        add_action( 'genesis_before_content', 'sk_isotope_filter' );
        function sk_isotope_filter() {
        	$args = array(
        		'orderby' => 'name',
        		'parent' => 0 // top level categories only
        	);
        	$categories = get_categories( $args );
        	?>
            <div id="filters">
            	<div id="filter-cont">
            	<label>Secciones:</label>
                <select name='cat' id='cat' class='postform'>
                    <option value="0">Todas Las Secciones</option>
                    <?php $category = get_category(get_query_var('cat')); 
        			$cat_id = $category->cat_ID; ?>
                    <?php foreach ( $categories as $category ) : ?>
                    <option value="<?php echo $category->cat_ID; ?>" <?php if ($cat_id==$category->cat_ID) {?>selected="selected"<?php } ?>><?php echo $category->name; ?></option> 
                    <?php endforeach; ?>       
                </select>  
                <script type="text/javascript">
            var dropdown = document.getElementById("cat");
            function onCatChange() {
        		if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
        			location.href = "<?php echo get_option('home');
        ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;
        		} else {
        			location.href = "<?php echo get_option('home');
        ?>/";
        		}
            }
            dropdown.onchange = onCatChange;
        </script>  
                </div>
            </div>
        	<?php
        }
        /** Code for custom loop */
        function my_custom_loop() { ?>
        		<div id="isotope">
        		<?php 		if (have_posts()) : ?>
        		<?php while (have_posts()) : the_post(); ?>
        			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
                    	<!--<span class="category"><?php //the_category(', ') ?></span>-->
                    	<a href="<?php the_permalink() ?>"><?php the_post_thumbnail('portfolio'); ?></a>
        				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                        <span class="time"><?php the_time('F j') ?></span>
        				<span class="author">Por <?php the_author_posts_link(); ?></span>
        			</div>
        		<?php endwhile; ?>
        		<?php else : ?>
        		<?php endif; ?>
                </div>
                <div class="clearfix"></div>
                <?php genesis_posts_nav(); ?>
        <?php }
        /** Replace the standard loop with our custom loop */
        remove_action( 'genesis_loop', 'genesis_do_loop' );
        add_action( 'genesis_loop', 'my_custom_loop' );
        //* Remove the post meta function for front page only
        remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
        genesis();

    Any ideas how to integrate this into my http://www.example.com/home2 http://www.example.com/home3. And yea from there ill use post or body classes to make my A/B tests using google analytics experiments

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble