Custom post types

Does this work with custom post types?

I would like to use this with themes that use custom post types including Classipress (http://www.appthemes.com/themes/classipress/).

  • Hakan
    • The Incredible Smush

    Hi philesq,

    It works off-the-shelf for most of the custom post types (Marketpress, Events+, almost all WPMU Dev plugin generated custom post types), but some other custom post types have their own templates which take the content directly from the database (e.g. WP e-commerce). For such custom post types you may need to edit your template as explained in "Customization Instructions" of the plugin.

    Here is a copy of that explanation from the settings page:

    Some custom post types use templates which take the post content directly from the database. For such applications you may need to use wpmudev_pwal function to manage the content.
    Example: Suppose that the content of a post type is displayed like this: <?php echo custom_description(); ?>. Then edit that part of the template like this:
    <?php
    if ( function_exists( 'wpmudev_pwal' ) )
         echo wpmudev_pwal( custom_description() );
    else
         echo custom_description();
    ?>

    If you have any problem during application please feel free to ask again.

    Cheers,
    Hakan

  • Hakan
    • The Incredible Smush

    Hi philesq,

    With Pay With a Like you can protect (i.e. displayed only after a like) any post, page or custom post content. It can be normal text, a video file, an image, etc...

    So if your listing will be pasted inside the content of a post or page or custom post, it will work. You can select which part of the content to be protected. So you can leave your regular content outside the protected area.

    Cheers,
    Hakan

  • dubya
    • The Incredible Code Injector

    Hi Hakan.
    I didn't have a chance to thank you for your assistance in the announcement thread. Thank you.
    Although this plugin does work in the custom post type's main content, I was unable to get it to work in a template.

    philesq is basically trying to do the same thing as me, we do not want to hide anything in the actual post...
    In a theme with front end posting, customers can post for free and optionally pay for their post to be featured (can also be free). This is all built in to the theme. We are looking for the ability to hide the featured option in the post creation form until the customer has "liked" us. This should be possible via template tags.
    Something like this should do the trick:

    <wpmudev_pwal mesage="Like us and get blah for free">
    some content to be hidden until liked goes here
    </wpmudev_pwal>

    Should I also file a feature request? Or will this suffice?

  • Hakan
    • The Incredible Smush

    Hi dubya,

    This will work provided that you select "selection tool" as the method (Selection tool is in fact an imitation of shortcode).

    {pwal id="0" description="Like us and get blah for free"]
    some content to be hidden until liked goes here
    [/pwal]

    I hope this helps.

    Cheers,
    Hakan

  • dubya
    • The Incredible Code Injector

    Thanks again.
    Unfortunately, it just echos the shot code itself. I even tried <?php echo do_shortcode('[pwal id=0 description=&quot;Like us and get blah for free&quot;]'); ?> with the same result (see attached).
    We're close, but from what I've read on .org, this is likely because the plugin is not designed to work outside of the loop.
    Any thoughts or ideas?

  • Hakan
    • The Incredible Smush

    Hi dubya,

    Inside the template you should use wpmudev_pwal php function. Do_shortcode will not work. Please see my first message above.

    Inside the post content, you should use the Selection Tool button to generate the shortcode-like wrapper to prevent any mistakes. For example id requires quotation marks as in id="0".

    Cheers,
    Hakan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.