How can we show the this promobar ONLY on one single specific page with css or other method?

Hey folks,

How can we show the this promobar ONLY on one single specific page with css or other method?

Let's say, for example, only on the support page here: http://bit.ly/1miXBjn You will see the bar at the top.

Can you post example code that could be used in Simple CSS plugin or even any other method?

Here is the plugin:
https://wordpress.org/plugins/dw-promobar/

:slight_smile:

  • Milan

    Hello @Greg,

    I hope you are having a good day and thanks for the asking. :slight_smile:

    It is not possible out of box right now with dw-promobar, but I think there is one way you can achieve this, but it requires little bit coding and editing core files to be done, if you don't mind I will post my solution once I'll create it and test it on my sandbox site, Till that time Would you please be patience. ? I will try my level best to make it integrated plugin first if its possible. :slight_smile:

    Please let me know if there is anything else I can help you with.

    Cheers!
    Milan.

  • Milan

    Hello @Greg,

    I hope you are having a good day.

    Please follow below Steps:

    Please just keep in mind that all files we are going to modify are under /wp-content/plugins/dw-promobar/ folder
    #1) Open dw-promobar-option.php file and go to end of the line no 64, add comma (,) there and hit enter then Please add below code,

    //page url settings
    'wpmu_specific_page_url'

    End changes after this step will look like as shown in screenshot.

    #2) Now go to end of the line no 519. And hit enter, then add below code there

    <tr valign=&quot;top&quot;>
    	<th scope=&quot;row&quot;><?php _e('Wpmu Custom Page Url','dwpb') ?></th>
    	<td>
    		<input type=&quot;text&quot; class=&quot;regular-text&quot; name=&quot;wpmu_specific_page_url&quot; value=&quot;<?php echo esc_url( get_option('wpmu_specific_page_url') ); ?>&quot; />
    	</td>
    </tr>

    End change after this step will look like as shown in screenshot.

    #3) Save Changes to that file.

    #4) Now open dw-promobar.php file.

    #5) Go to line no, 70 hit enter and paste beow code snippet,

    if( !is_admin() ) {
    
    			// echo get_permalink();
    			// echo esc_url( get_option( 'wpmu_specific_page_url', '' ) );
    			// var_dump( get_permalink() == esc_url( get_option( 'wpmu_specific_page_url', '' ) ) );
    			if( get_permalink() != esc_url( get_option( 'wpmu_specific_page_url', '' ) ) ){
    				return;
    			}
    
    		}

    End change after this step will look like as shown in screenshot.

    That's it.

    Now add url of page on which you want to show promobar.

    I hope this helps you.

    Please let me know if there is anything else I can help you with.

    Cheers!
    Milan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.