• 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

iamzeus

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 20 posts - 1 through 20 (of 21 total)
1 2 →
  • Author
    Posts
  • March 14, 2017 at 11:04 am in reply to: Load style.css async #203084
    iamzeus
    Member

    Another question, how do I add cache busting query strings of last mod to that function i Just posted?

    This is my query string last mod function

    // Replace Query String for Last Modified String
    add_action( 'wp_enqueue_scripts', 'cache_buster_styles' );
    function cache_buster_styles() {
    	// Get the stylesheet info.
    	$stylesheet_uri = get_stylesheet_directory_uri() . '/style.css';
    	$stylesheet_dir = get_stylesheet_directory() . '/style.css';
    	$last_modified = date ( "ymd.h.i.s", filemtime( $stylesheet_dir ) );
    	// Enqueue the stylesheet.
    	wp_enqueue_style( 'cache-buster' , $stylesheet_uri, array(), $last_modified );
    }

    How to I implement that into my correct function that mos my style.css

    // load styles asynchronously
    add_filter( 'style_loader_tag', 'style_transform_loadCSS', 10, 2 );
    function style_transform_loadCSS( $html, $handle ) {
    	if ( CHILD_THEME_NAME == $handle )
    		$searchArray = array("rel='stylesheet' id='$handle-css'", "type='text/css' media='all'");
    		$replaceArray = array("rel=\"preload\"", "as=\"style\" onload=\"this.rel='stylesheet'\"");
    	return str_replace($searchArray, $replaceArray, $html)."<noscript>{$html}</noscript>";
    	return $html;
    
    }
    March 14, 2017 at 10:14 am in reply to: Load style.css async #203081
    iamzeus
    Member

    Thanks a lot, yea needed $handle as well :), ended up with this solution:

    // load styles asynchronously
    add_filter( 'style_loader_tag', 'style_transform_loadCSS', 10, 2 );
    function style_transform_loadCSS( $html, $handle ) {
    	if ( CHILD_THEME_NAME == $handle )
    		$searchArray = array("rel='stylesheet' id='$handle-css'", "type='text/css' media='all'");
    		$replaceArray = array("rel=\"preload\"", "as=\"style\" onload=\"this.rel='stylesheet'\"");
     	return str_replace($searchArray, $replaceArray, $html);
    	return $html;
    }

    thanks for the help

    March 12, 2017 at 7:04 pm in reply to: How to remove html5shiv.min.js ? #202963
    iamzeus
    Member

    Just tried it but it didnt work 🙁

    January 28, 2016 at 1:31 pm in reply to: How to duplicate my homepage for A/B testing #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

    May 5, 2015 at 1:00 pm in reply to: Add 2 colors or span classes to my site-title to have different colors in my tit #150257
    iamzeus
    Member

    Thanks a lot, just what i needed

    January 20, 2015 at 2:33 pm in reply to: Randomize a Hook Function in my functions.php to A/B test an ad #138122
    iamzeus
    Member

    Something like:

    add_action( 'genesis_meta', 'randomhook' );
    function randomhook() {
    $option[0] = add_action('genesis_after_header', 'topadd0');
    $option[1] = add_action('genesis_before_loop', 'topadd1');
    return $option[rand()%count($option)];
    }

    But this one isnt really working

    January 18, 2015 at 8:15 pm in reply to: Move Style.css stylesheet to the footer rather than header #137901
    iamzeus
    Member

    Im already inlinin the critical above the fold css, why would it be a bad idea to load the style.css later on?

    Anyhow whats the easiest way to do it

    January 17, 2015 at 6:06 pm in reply to: Move Style.css stylesheet to the footer rather than header #137814
    iamzeus
    Member

    To the footer I meant

    Is there a way? To test it, im using autoptimize and it puts it in the footer but ads it as a nonscript and wanna move it myself better

    January 6, 2015 at 5:55 pm in reply to: How to add inline css before the style.css #136224
    iamzeus
    Member

    My bad, worked putting priority as 1

    thanks

    January 6, 2015 at 5:38 pm in reply to: How to add inline css before the style.css #136222
    iamzeus
    Member

    Mmmmm saw this guys inlined a lot of it:

    http://www.smashingmagazine.com/2014/09/08/improving-smashing-magazine-performance-case-study/

    to improve the rendering of the page

    so wanna do the same with my critical above the fold css

    January 6, 2015 at 3:56 pm in reply to: How to add inline css before the style.css #136213
    iamzeus
    Member

    Tried this already, but 'wp_head' will add it to the end of my head

    I want to load if before my style.css sheet

    Want to inline my critical above the fold css

    December 23, 2014 at 6:10 pm in reply to: Can't get youtube embeds to be full width #135217
    iamzeus
    Member

    Adding this to functions.php

    // Embed width
    if ( ! isset( $content_width ) ) $content_width = 730;

    December 22, 2014 at 2:09 pm in reply to: Make genesis_before_loop hook to work #135071
    iamzeus
    Member

    Hook worked but seems was a css wrongly set for posts

    .single .content .entry in CSS was the solution for the borders

    December 22, 2014 at 12:18 pm in reply to: Can't get youtube embeds to be full width #135068
    iamzeus
    Member

    Thanks a lot

    November 8, 2014 at 11:53 am in reply to: Add a hook just fo posts and avoid homepage, pages and sections #130927
    iamzeus
    Member

    Thanks a lot 🙂

    August 7, 2014 at 1:19 pm in reply to: Responsive or scaled images in Modern Portfolio Pro #117626
    iamzeus
    Member

    Did a testing here as well:
    http://gtmetrix.com/reports/demo.studiopress.com/djtBzS4T

    its the theme the one that doesnt serve the scaled images, how to fix this so my mobile users dont waste huge amounts of bandwith

    August 7, 2014 at 1:12 pm in reply to: Responsive or scaled images in Modern Portfolio Pro #117622
    iamzeus
    Member

    Checked this and its the theme

    I disabled even all my plugins to test it and its not serving scaled images

    even tested the theme in gtmetrix the original one

    http://gtmetrix.com/reports/my.studiopress.com/62tqhpsv

    how to fix this/

    August 2, 2014 at 5:36 pm in reply to: Responsive or scaled images in Modern Portfolio Pro #116770
    iamzeus
    Member

    Good day
    yes

    site is:
    http://www.recreoviral.com

    July 24, 2014 at 10:28 pm in reply to: remove comment-reply.js #115795
    iamzeus
    Member

    Wow, great... that did the job, thanks a lot

    July 21, 2014 at 11:07 pm in reply to: remove comment-reply.js #115323
    iamzeus
    Member

    Im interested in this as well?

    how did you removed it?

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 21 total)
1 2 →

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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