Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1028
    Profile photo of Leo
    Leo
    Participant

    Here is a block of code you can insert into Symbiostock’s plugin “Genetics Lab” theme upgrader.

    To take advantage of it, see the “Symbiostock Genetics Lab” plugin here: http://www.symbiostock.com/products-page/product-category/symbiostock-genetic-lab-code-modifier-and-enhancer/

    After inserting this code, an option will appear at the bottom of the Symbiostock Genetics Lab panel – asking you to insert the number of posts you’d like to see per page on search results. Simply input the number and your done!


    < ?php
    function gl_setposts_infusion(){
    function gl_mod_search( $query ) {
    global $network_search;
    //$network_search = get_query_var('symbiostock_network_search');
    if($network_search != true && !is_admin()){
    $per_page = get_option('gl_posts_per_page', 24);
    $query->set('posts_per_page', $per_page);
    return;
    }
    }
    add_action( 'pre_get_posts', 'gl_mod_search', 10);
    }
    add_action( 'after_setup_theme', 'gl_setposts_infusion' );

    function gl_set_post_results(){
    wp_verify_nonce('gl_setposts_action');
    if(isset($_POST)){
    if(is_numeric($_POST))
    update_option('gl_posts_per_page', trim($_POST));
    }
    ?>

    < ?php wp_nonce_field('gl_setposts_action'); ?>



    < ?php
    }
    add_action( 'gl_custom_actions_after', 'gl_set_post_results' );
    ?>
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.