• I’m using WP 1.5.1 and have created a few pages that I am populating with content via individual plugins. Since plugins get applied to every page, I was wondering what the best way to make a certain plugin only work on a certain page.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • depends on the plugin, the template you use for your pages, the version of wp as well.

    for example, you can customise some plugins to work only on certain pages (such as index.php) but not on others (such as about.php and so on).

    So what’s your question, what plugins are you trying to use on certain pages, what certain pages are we talking about, and what is it you want the final out come to be.

    Thread Starter thejoker101

    (@thejoker101)

    Let’s say I have a page here: /page1, I want the plugin to only work for this page and no others.

    I’m on WP 1.5.1 and I’m currently using the default Kubrick theme, but I’ll be writing my own once I get core functionality done.

    Since you failed to mention which plugins, I’ll just simplify the answer to “no.” There’s no way to generically have plugins only run on certain pages.

    Thread Starter thejoker101

    (@thejoker101)

    I’m writing the plugins. Most don’t exist yet.

    He is incorrect.

    You can copy your index.php file in your theme directory to page1.php

    inside of page1.php put this at the top:

    <?php
    /*
    Template Name: Page 1
    */
    ?>

    Then remove the loop from the template you made (assuming you dont want this page to display posts and only want it to display your plugin), and place the function for your plugin in place of it.

    Then go to the admin page of your site and “Write Page”, don’t forget to choose the “Page 1” template for your page.

    Many plugins can be used this way. custom archive plugins, the itunes plugin from lucky33, etc..

    If you dont want your plugin to run on index.php but do want it to be on the individual post pages you can copy index.php to single.php(included in kubrick theme already) and place it in that file.

    You can also call the function from inside of a post by using a plugin like PHPExec https://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin on specific page only’ is closed to new replies.