Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to duplicate my homepage for A/B testing
- This topic has 2 replies, 2 voices, and was last updated 8 years, 7 months ago by iamzeus.
-
AuthorPosts
-
January 27, 2016 at 10:46 am #177671iamzeusMember
Good day
I have some internal pages lets say:
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 #177678Cathy @ WPBaristaMemberTo 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 #177762iamzeusMemberIm 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
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.