Viewing 7 replies - 1 through 7 (of 7 total)
  • See this earlier thread. This resolved the issue for me, although it needs be done repeatedly through updates to the Enigma there.

    Hello mpbgraphics,

    If you want to remove this banner then just go to theme directory open functions.php and see the below code on line no 496 –

    if (get_template_directory() == get_stylesheet_directory()) {
    add_action( 'admin_notices', 'enigma_rating' );
    function enigma_rating() {
        ?>
        <div class="notice error my-acf-notice is-dismissible notice-box" >
            <p><?php _e( 'Thank You for using Enigma theme, Please give your reviews and ratings on Enigma theme. Your ratings will help us to improve our themes.','enigma' ); ?></p>
    		<p style="font-size:17px;"> 
    			<a style="color: #fff;background: #ec635b;padding: 3px 7px 4px 6px;border-radius: 5px;" href="<?php echo esc_url('https://ww.wp.xz.cn/support/theme/enigma/reviews/?filter=5');  ?>" target="_blank"><?php _e('Rate the theme','enigma') ?></a>
    		</p>
        </div>
        <?php
    }
    function enqueue_custom_admin_style() {
            wp_register_style( 'custom_admin_css', get_template_directory_uri() . '/core/admin/admin-rating.css');
            wp_enqueue_style( 'custom_admin_css' );
    }
    add_action( 'admin_enqueue_scripts', 'enqueue_custom_admin_style' );
    } else {
    	add_action( 'admin_notices', 'greenigma_rating' );
    function greenigma_rating() {
        ?>
        <div class="error my-acf-notice is-dismissible notice-box1" >
            <p><?php _e( 'Thank You for using Greenigma theme, Please give your reviews and ratings on Greenigma theme. Your ratings will help us to improve our themes.','Greenigma' ); ?></p>
    		<p style="font-size:17px;"> 
    			<a style="color: #fff;background: #ec635b;padding: 3px 7px 4px 6px;border-radius: 5px;" href="<?php echo esc_url('https://ww.wp.xz.cn/support/theme/greenigma/reviews/#new-post');  ?>" target="_blank"><?php _e('Rate the theme','enigma') ?></a>
    		</p>
        </div>
        <?php
    }
    function enqueue_custom_admin_style() {
            wp_register_style( 'custom_admin_css', get_template_directory_uri() . '/core/admin/admin-rating.css');
            wp_enqueue_style( 'custom_admin_css' );
    }
    add_action( 'admin_enqueue_scripts', 'enqueue_custom_admin_style' );
    }

    remove all code and save the file. Banner will be gone after removing the code.

    Thank-you.

    Don’t remove the code from line 496

    if (get_template_directory() == get_stylesheet_directory()) {

    That just breaks things. This will work by deleting the code from lines 497 to 512. Of course this would be better if we could just dismiss this once and be done with it as was promised a couple of updates ago.

    Thanks for your suggestion. We remove that code then it does not affect other functionality so we can remove this.

    Hello mattormatt,

    Go to enigma theme directory -> functions.php file -> see the below code from line no. 495 to 529 –

    if (get_template_directory() == get_stylesheet_directory()) {
    add_action( 'admin_notices', 'enigma_rating' );.......}

    replace it with below code and save the file –

    // display custom admin notice
    function enigma_custom_admin_notice() {
    	wp_register_style( 'custom_admin_css', get_template_directory_uri() . '/core/admin/admin-rating.css');
        wp_enqueue_style( 'custom_admin_css' );
    	$wl_th_info = wp_get_theme(); 
    	$currentversion = str_replace('.','',(esc_html( $wl_th_info->get('Version') )));
    	$isitdismissed = 'enigma_notice_dismissed'.$currentversion;
    	if ( !get_user_meta( get_current_user_id() , $isitdismissed ) ) { ?>
    	<div class="notice-box notice-success is-dismissible flat_responsive_notice" data-dismissible="disable-done-notice-forever">
    		<div>
    			<p>	
    			<?php _e('Thank you for using the free version of ','enigma'); ?>
    			<?php echo esc_html( $wl_th_info->get('Name') );?> - 
    			<?php echo esc_html( $wl_th_info->get('Version') );
    			 ?>
    			<?php _e('Please give your reviews and ratings on '. $wl_th_info->get('Name') .' theme. Your ratings will help us to improve our themes.', 'enigma'); ?>
    				<script type="text/javascript">alert(<?php echo $isitdismissed?>);</script>
    			<a class="rateme" href="<?php echo esc_url('https://ww.wp.xz.cn/support/theme/enigma/reviews/?filter=5');  ?>" target="_blank" aria-label="Dismiss the welcome panel">
    				<strong><?php _e('Rate Us here','enigma');?></strong>
    			</a>
    			<a href="?-notice-dismissed<?php echo $currentversion;?>">Dismiss</a>
    			</p>
    		</div>
    		
    	</div>
    	
    <?php
    	}
     }
    add_action('admin_notices', 'enigma_custom_admin_notice');
    
    function enigma_notice_dismissed() {
    	$wl_th_info = wp_get_theme(); 
    	$currentversion = str_replace('.','',(esc_html( $wl_th_info->get('Version') )));
    	$dismissurl = '-notice-dismissed'.$currentversion;
    	$isitdismissed = 'enigma_notice_dismissed'.$currentversion;
        $user_id = get_current_user_id();
        if ( isset( $_GET[$dismissurl] ) )
            add_user_meta( $user_id, $isitdismissed, 'true', true );
    }
    add_action( 'admin_init', 'enigma_notice_dismissed' );

    no open core folder -> admin -> open admin-rating.css file paste the below code after line no. 33 and save the file –

    .notice-box.notice-success {
        border-left: 4px solid #d64d22;
    }
    .notice-box p, .notice-box1 p {
        padding: 10px;
    }
    .notice-box.notice-success a {
        color: #d64d22;
    }
    a.rateme {
        padding: 2px;
        color: #d64d22;
        font-size: 16px;
    }

    Apologies we miss this code in update in future

    Thanks.

    Thanks Weblizer. That appears to have resolved the issue for the never ending prompt to rate the theme. Worth noting that for wp-content/themes/enigma/core/admin/admin-rating.css file that there were only 23 lines in that file and I pasted the snippet above at line 24.

    Your Welcome,

    Let us know for further query.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Rate the theme’ is closed to new replies.