Gridmarket - multisite marketpress stores.

Appears that in NBT - if template blogs are not active they do not transfer..

Ie: How to avoid NBTemplates showing in the Gridmarket global store dropdown?

If we deactivate it seems the templates do not function and it defaults to the WP theme not the NBT.

  • Jack Kitterhing
    • Code Norris

    Hi there @be,

    Hope your well today and thanks for your question, that's correct, the template must be active to show and this then shows in the dropdown.

    I've flagged the lead developer of NBT to provide his valuable input of how we could stop this from being included in the drop down.

    Thank you!

    Kind Regards
    Jack.

  • Ignacio
    • HummingBird

    Hi @be.

    Sorry for the late here. I just released a new version of New Blog Templates but we need to wait until the FrameMarket Theme releases a new version too, however the change is easy so you don't need to wait. Just open the following file:

    wp-content/themes/framemarket/library/functions/marketpress.php. You'll see a function called framemarket_listall_shops that has a line like this:

    $blogs = $wpdb->get_results($query);

    You'll need to add another sentence just below that line:

    $blogs = apply_filters( 'framemarket_list_shops', $blogs );

    So the function, at the end, looks like this:

    function framemarket_listall_shops(){
    	global $wpdb;
        $query = "SELECT blog_id FROM " . $wpdb->base_prefix . "blogs WHERE spam != '1' AND archived != '1' AND deleted != '1' AND public = '1' ORDER BY path";
    
        $blogs = $wpdb->get_results($query);
        $blogs = apply_filters( 'framemarket_list_shops', $blogs );
        ?>
    <select name="shoplist" onchange="document.location.href=this.options[this.selectedIndex].value;">
    	<option value="">Visit a shop</option>
    	<?php
        foreach($blogs as $blog){
            $blog_details = get_blog_details($blog->blog_id);
    ?>
    <option value="<?php echo $blog_details->siteurl; ?>"> <?php echo $blog_details->blogname; ?></option>
    <?php
        }
    ?>
     </select>
    <?php
    }

    As soon as you update New Blog Templates with the newest version, those templates should be removed from the dropdown.

    Regards.
    Ignacio.

  • Jack Kitterhing
    • Code Norris

    Hi there @be,

    Hope you're well today, I've checked this and it does indeed have that filter, Ignacio is away at the moment.

    If you could send me some FTP to contact(at)wpmudev.org with the subject line Attn: Jack Kitterhing, I'd be happy to take a look for you :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there @be,

    Sorry about the delay here, just taken a look at this and it appears you have the old version.

    There was a mistake in numbering just spotted and there's a 2.5 with the fix and one without, the file in questions is integration.php in blogtemplates > blogtemplatesfiles.

    We've just corrected that and you want version 2.5.1 from here https://premium.wpmudev.org/project/new-blog-template/ and it will then work correctly.

    Sorry about the mistake.

    Thank you!

    Kind Regards
    Jack.

  • be
    • WP Core Meltdown

    thanks @Jack Kitterhing

    Well - ummm..
    updated
    NBT - have 2 only templates before we create/copy more.
    First template is no longer in dropdown
    2nd template is.

    We created a site as we needed with all categories etc etc..
    Then Copied that site - renamed and recoloured etc to have a second template.
    This does work as a second template
    However this appears to be an issue as in it is keeping the original copied name.

  • Ignacio
    • HummingBird

    Hi @be.

    Sorry for the late. I've been on vacation and now I have a bunch of work to do.

    The problem you named is weird. As I see, you have two templates with different names (I guess) but that they are based on the same blog called "this colour/font". NBT uses native WordPress functions there so it should get the actual and not the old name of the blog.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.