Support » Fixing WordPress » [Plugin: Constant Contact for WordPress] Insert Constant Contact into single page

  • Hi and thanks for the fantastic widget! Can you tell me if there is a way to insert the Constant Contact form input into a single page rather than the side bar. Thanks so much in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • We have plans for this in a future release, it will allow you to insert a signup form into a single post using a shortcode in the post body, I can’t put a time on when this might happen but likely to be a couple of months.

    Zack Katz


    This is only tested once, but it should work until we release the version James is talking about:

    $CC = new constant_contact_api_widget();

    This should work properly, but once we change how widgets are configured, it likely won’t work in the next version.

    Thanks for the quick response! In the meantime your workaround…

    $CC = new constant_contact_api_widget();

    Where is this code placed? I am mostly a designer…forgive the ignorance. Best!


    Zack Katz


    In the template wherever you want the form to be shown. Or you could download a plugin that runs PHP inside the content and add it to your content that way. You could try Sniplets, by John Godley.

    Dang. I was going to turn this into a shortcode but it wont’ work properly because the widget?() method echo’s the $output no matter what. To be shortcode-compatible all display functions need to offer an $echo parameter in their $args so that it can be turned off and the html returned by the method instead.

    That would probably be the best place to start the process of shortcoding the widget stuff. Once you have that in place the actual shortcode is ludicrously trivial:

    function constant_contact_shotcode($atts) {
    	$CC = new constant_contact_api_widget();
    	$output = $CC->widget('echo=0');
    	return $output;
    add_shortcode('constant_contact_form', 'constant_contact_shotcode');

    Thanks for the plugin, I’ll just deal with the sidebar version for now.

    We have plans for this as mentioned, you seem to know PHP so if you decide to implement this yourself please let us have the code and we can probaly include it within the plugin for everyone to use.

    Thanks for the tips so far. I am not a coder of any sorts, but can follow the logic here. I put the sniplets plugin into my site. When I paste the code you put above:
    -> $CC = new constant_contact_api_widget();
    -> $CC->widget();
    into the sniplet, all I get is that text returned. What else do I need wrapped around it to make it work in the sniplet. Thanks much! Dan

    Jer Clarke


    @jamesbenson: Cool, its probably fairly simple, usually it just means adding all output to an $output variable as you go instead of echoing it, then at the end you return $output or print it depending on the $args[‘echo’] parameter.

    I’m working on something else at the moment but when I get back to my concon stuff I’ll try to make a patch for you including the shortcode.

    Sorry for the slow reply, I didn’t see your response till now because of hte lack of forum subscriptions, I’m subscribing to this thread now!

    Any updates on this? I would LOVE to be able to embed it into a page rather than via widget on the front page.


    Ouch! I really need to put this on a page; we have lots of Constant Contact list options.
    Anybody done this and willing to step through it with an old guy that can’t even spell coode?

    I need this too, the ability to place the sign up form on a page and not as a widget.

    I used the following, as suggested above, on a site with Exec-PHP installed.

    $CC = new constant_contact_api_widget();

    This just displayed the above as text

    also tried:
    <?php constant_contact_api_widget-3; ?>

    which displayed nothing.

    Thanks in advance for any help!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Constant Contact for WordPress] Insert Constant Contact into single page’ is closed to new replies.