• RobR

    (@robr)


    Is there a way around using WP Page to put the Subscribe2 code into for the subscribe and unsubscibe bits too work?

    I asked Matt, who is currently maintaining Subscribe2, about this and he was not sure and suggested I look at the WP forums. I have read several topics and have learnt a few things but still am not sure about my problem.

    On my simple blog, https://engtect.net , I have an index of posts and then run in order and I use the IDs for the permalinks as in /%post_id%. Anywho, subscribe2, like a few other email list plugins, require using a page to put their code on. But using a page uses up an ID (for posts and pages) and so messes up my layout. Is there a way round this?

    I read about using templates and wondered if that could be a way. Could I make an ordinary php page and include WP’s page.php and then put the < – – subscribe2 – – > bit in there?

    I am currently running WP 2.02 but as my blog no longer works as I reset the IDs in MySQL after deleting a page blah blah blah I need to rebuild it and so will install 2.05. I am not running any other plugins.

    If this is not something that can be achieved is there another new post emailing plugin available that would work for my unusual needs?

    Thanks.

Viewing 1 replies (of 1 total)
  • Kafkaesqui

    (@kafkaesqui)

    This is possible with Subscribe2, but keep in mind there are elements of it which *may not* work out perfectly:

    1. Copy the page.php template from your current theme. If the theme doesn’t have one, copy its index.php.

    2. Name the new template subscribe.php. That file name should look familiar…

    3. At the very top of subscribe.php, insert this line:

    <?php include('./wp-blog-header.php'); ?>

    This ‘adds’ the WordPress header file, which makes all WP features available outside the theme hierarchy. As you’ll be moving the template to your blog’s root (step 5), we’ll assume the path to wp-blog-header.php is correct here.

    4. The hack step. :)

    We don’t have a Page providing the Subscribe2 tag so we have to fake it. To do this, locate where the_content() is in subscribe.php. Typically it will appear as:

    <?php the_content(); ?>

    Change that line to:

    <?php echo apply_filters('the_content', '<!--subscribe2-->'); ?>

    5. Move subscribe.php to your blog’s root/installation directory.

    6. There are likely to be additional edits you’ll want to make. A necessary one will be if you have this in the template:

    <?php the_title(); ?>

    As it will output the title of the latest post WordPress finds, I suspect you’ll want to replace it with a hardcoded title of your own. But start looking at your Subscribe2 “Page” to see what doesn’t need to be there (and what may be missing).

Viewing 1 replies (of 1 total)
  • The topic ‘Accessing WP without page or post for Subscribe2’ is closed to new replies.