Sorting or removing ALL option from Blog Templates

Hello,

For New Blog Templates plugin, is it possible to re-organize how the template screenshots are displayed, or more importantly remove the ALL tab from the category list and set the category order?

Thanks, Chris

  • Vaughan

    Hi @crazybodyfitness,

    you would need to custom code this in the plugin. currently it's not possible to change it from within the settings.

    You can edit blogtemplates/blogtemplatesfiles/blog_templates_theme_selection_toolbar.php

    find the following;

    public function display() {
    		$this->render_css();
    		?>
    			<div id="nbt-toolbar" data-toolbar-type="<?php echo $this->type; ?>">
    				<a href="#" id="item-0" class="toolbar-item" data-cat-id="0"><?php _e( 'ALL', 'blog_templates' ); ?></a>
    				<?php foreach ( $this->categories as $category ): ?>
    					<a href="#" id="item-<?php echo $category['ID']; ?>" class="toolbar-item" style="opacity: 0.62;" data-cat-id="<?php echo $category['ID']; ?>"><?php echo $category['name']; ?></a>
    				<?php endforeach; ?>
    				<div style="clear:both"></div>
    			</div>
    		<?php
    	}

    and comment out/remove the following line;

    <a href="#" id="item-0" class="toolbar-item" data-cat-id="0"><?php _e( 'ALL', 'blog_templates' ); ?></a>

    Hopefully that should get rid of the 'All' nav item, I haven't tested tho.

    Regarding the sort order, I might have to ask the developer for a bit of feedback on this for you.

    hope this helps

  • Ignacio

    Hi @Christopher.

    We just released a new version of the plugin (2.6.1). Please, download it.

    Now you can modify the tabs in the categories selection toolbar with this code:

    add_filter( 'nbt_selection_toolbar_tabs', 'remove_all_tab_theme_selection' );
    function remove_all_tab_theme_selection( $tabs ) {
    	unset( $tabs[0] );
    	return $tabs;
    }

    The $tabs array has the following structure:

    $tabs[0] = 'ALL'
    $tabs[1] = 'A CATEGORY NAME 1'
    $tabs[2] = 'A CATEGORY NAME 2'

    Where the keys of the array are the category ID. If you want to remove the ALL label you just need to remove the category ID = 0. Then, the toolbar will show 'A CATEGORY NAME 1' as default. If you want to change this too, you can with the following code:

    add_filter( 'nbt_selection_toolbar_default_tab', 'set_default_tab_theme_selection' );
    function set_default_tab_theme_selection( $default_tab ) {
    	return 2;
    }

    That way, the default category displayed will be 'A CATEGORY NAME 2'.

    Could you test and tell us if is working fine for you?

    Regards.
    Ignacio.

  • Ignacio

    Hi @Christopher

    You can do it in two ways:

    - Insert the code inside your theme functions.php file (the theme that is activated in your main blog)
    - Create a new plugin for that (best option, you won't loose the changes if you change your theme).

    Anyway, attach to this post there's a zip file with a new plugin and the code above. Just upload it as any other plugin and network activate it.

    Regards.
    Ignacio.

  • Ignacio

    Hi @Christopher

    I'm very sorry for the delay here, I completely missed your answer.

    I've been testing this and I could not reproduce the issue, could you pass me the following information?

    - Blog Templates Settings: What's the value for "Show templates selection on registration" and "Type of selection"?
    - What kind of settings do you have selected for your default template?
    - What kind of settings do you have selected for the template that you try with on signup page?

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.