Show plugin only on a specific page

I am using the plugin Connections in my website. Now I created a page exclusively for this, so the directory listing has to be only shown if the page is “Directory” and it has to be shown in center.

Currently the plugin is shown in sidebar. How can I solve this issue?

Related posts

Leave a Reply

1 comment

  1. I found this function which can help u. The key is to change the handle, in this case is contact-form-7. This code snippet will prevent contact-form-7 script from loading except in contact page.

    add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
    function my_deregister_javascript() {
        if ( !is_page('Contact') ) {
            wp_deregister_script( 'contact-form-7' );
        }
    }
    

    To get this handler for each script. To do this, you’ll need to open up the main PHP file for each plugin that’s on your list. I did this for WPNG Calendar by going into the plugins folder in FTP and opening wpng-calendar.php in an editor, then doing a search for wp_enqueue_script, which loads JavaScripts into generated pages in WordPress. The handle is the first element in parentheses in each wp_enqueue_script line.

    I got the info from http://www.position-relative.com/2010/wordpress/wordpress-only-load-plugins-on-pages-that-need-them/

    To show in the center just edit your CSS, if u have some width defined to your directory listing adding margin:0 auto 0 auto; should be enough