1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How To: Outputting from my plugin with the theme

Discussion in 'WordPress' started by sarahk, Jun 21, 2010.

  1. #1
    I'm trying out a newsletter script and when users confirm their email subscription they are taken to a plain screen. I'd like to wrap my plugin output with the theme.

    Has anyone done something like this before? Any hints or tips?
     
    sarahk, Jun 21, 2010 IP
  2. bhuthecoder

    bhuthecoder Member

    Messages:
    245
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    43
    #2
    hi,
    u need to edit newsletter.php in plugin folder and create a page for messages in ur wordpress.

    Example :
    for displaying "Thank you. You are subscribed now!" message with ur theme.

    step1:
    open newsletter.php in a text editor and replace the code (line no 286)
    echo("Thank you. You are subscribed now!");
    Code (markup):
    with
    header( 'Location: http://www.ursite.com/thank_you/' ) ; 
    Code (markup):
    save and upload it.

    step2:
    now login to ur blog and create a page with
    title "Thank you"
    description "You are subscribed now!"
    publish it.

    Done!

    now people redirect to http://www.ursite.com/thank_you/ instead of showing the message

    note: u can hide these pages from displaying in navigation bar using plugins.
     
    bhuthecoder, Jun 22, 2010 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #3
    That's a great idea, thanks.

    I've changed my 404 page to include
    <?php 
    if (isset($_GET['msg'])) $msg = $_GET['msg'];
    else $msg = "Sorry, but the page you requested could not be found. Perhaps searching will help.";
    ?>
    <h2 class="center"><?php echo $msg; ?></h2>
    
    PHP:
    so I won't need to have a hidden page, I just need to ensure that my newsletter script never calls a real page.
     
    sarahk, Jun 22, 2010 IP