Is there a way to pair New Blog Templates with Pro Sites levels?

I have 3 Pro Site levels with 3 different corresponding Blog Templates. The user needs to select the right Blog Template to correspond to their Pro Site level. Is there any way to pair them so that a Blog Template is only available for selection at registration if the user selects the corresponding Pro Site level?

  • Dimitris

    Hello there Brett,

    hope you're doing well today! :slight_smile:

    I tried to make this work using the
    Pro Sites -> Modules -> Premium Themes
    but after going to
    Pro Sites -> Premium Themes
    you can see that we can "Select the minimum Pro Site level"
    so this results in a situation where the higher plan also has access to blog templates of the lower ones.



    So in the above example, the Semi-pro level will only see the "Radcliffe" template but the Pro level will see both "Radcliffe" and "Divi" templates.

    I've already forwarded this to our Second Level Support team, just in case we can provide some kind of hotfix for it. Will keep you posted here as soon as there's any development on this, your patience is highly appreciated!

    Warm regards,
    Dimitris

  • Konstantinos Xenos

    Hi Brett and sorry for the late reply.

    You can achieve the result of showing 'specific' New Blog Templates depending on the Pro Site level by using this code like so:

    How to install:
    Always make sure to keep a backup of your site before changing/adding custom code.

    1] Navigate to your /wp-content/ directory and create a new one named mu-plugins if it doesn't exist.
    2] Inside the mu-plugins folder create a file named pro-nbt.php
    3] Edit the file and copy / paste this code snippet inside.

    <?php
    
    add_action(
    	'wp_footer',
    	function() {
    		?>
    		<script>
    		( function ( $ ) {
    			$( document ).ready( function() {
    				$( '.template-signup-item.theme-radio-wrap' ).each( function(){
    					$( this ).css( 'display', 'none' );
    				} );
    				$( '#prosites-checkout-table button' ).on( 'click', function( e ) {
    					var target = $( this );
    					if ( target.parent().parent().hasClass( 'psts-level-1' ) ) {
    						$( '#theme-screenshot-radio-1' ).css( 'display', 'block' );
    						$( '#theme-screenshot-radio-1 input' ).click();
    						$( '#theme-screenshot-radio-1' ).siblings().each( function(){
    							$( this ).css( 'display', 'none' );
    						} );
    					} else if ( target.parent().parent().hasClass( 'psts-level-2' ) ) {
    						$( '#theme-screenshot-radio-2' ).css( 'display', 'block' );
    						$( '#theme-screenshot-radio-2 input' ).click();
    						$( '#theme-screenshot-radio-2' ).siblings().each( function(){
    							$( this ).css( 'display', 'none' );
    						} );
    					} else if ( target.parent().parent().hasClass( 'psts-level-3' ) ) {
    						$( '#theme-screenshot-radio-3' ).css( 'display', 'block' );
    						$( '#theme-screenshot-radio-3 input' ).click();
    						$( '#theme-screenshot-radio-3' ).siblings().each( function(){
    							$( this ).css( 'display', 'none' );
    						} );
    					}
    				} );
    			} );
    		} ( jQuery ) );
    		</script>
    		<?php
    	},
    	999
    );

    4] Save and close the file.
    5] The final path should look like /wp-content/mu-plugins/pro-nbt.php

    The above code is based on the same setup that has 3x Pro Sites levels and 3x New Blog templates so it might work out of the box as well, but some code changing may be needed as well.

    Tell me if you need further help with this!

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.