Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. brycejacobson revised this gist Aug 14, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions genesis-custom-enqueue-script.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    <?php
    //* Do NOT include the opening php tag

    /** Load scripts on Portfolio page */
    add_action('genesis_after_footer', 'child_load_portfolio');
    function child_load_portfolio() {
  2. brycejacobson renamed this gist Jul 23, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @jonbellah jonbellah created this gist Jan 21, 2013.
    29 changes: 29 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    /** Load scripts on Portfolio page */
    add_action('genesis_after_footer', 'child_load_portfolio');
    function child_load_portfolio() {
    if(is_page('Portfolio')) {
    wp_register_script( 'isotope', get_bloginfo('stylesheet_directory').'/lib/js/jquery.isotope.min.js' );
    wp_enqueue_script ( 'isotope' );
    }
    }

    /** Isotope vars */
    add_action('genesis_after', 'child_script_portfolio');
    function child_script_portfolio() {
    if(is_page('Portfolio')) { ?>
    <script type="text/javascript">
    var $container = $('#container');
    // initialize isotope
    $container.isotope({
    layoutMode: 'fitRows',
    });

    // filter items when filter link is clicked
    $('#filters a').click(function(){
    var selector = $(this).attr('data-filter');
    $container.isotope({ filter: selector });
    return false;
    });

    </script>
    <?php } }