Forums

[resolved] Using shortcodes and plugins in a custom page (12 posts)

  1. moxyma
    Member
    Posted 4 months ago #

    Can someone please tell me how I can go about being able to using WordPress plugins and shortcodes in a custom page I created? I need to add shortcodes for audio and pagination for a custom page. Do I need to put it in The Loop or something? Sorry if that is a really dumb question but as you can probably tell I am not an expert but I have done some reading.. so any help would be greatly appreciated. :)

  2. SwansonPhotos
    Member
    Posted 4 months ago #

    Depending on the shortcode (some only work in the loop) you can use this basic example:

    <?php echo do_shortcode('[shortcode]'); ?>

  3. moxyma
    Member
    Posted 4 months ago #

    Hi Swanson,

    Thank you! I'll try this and see if it works and post back, okay? :)

    But if the plugin I'm using does require that my custom page be in the loop is there anything I can do?

  4. SwansonPhotos
    Member
    Posted 4 months ago #

    You would just add the shortcode to a page or post (in html view). Check the documentation with the plugin or shortcode...

  5. moxyma
    Member
    Posted 4 months ago #

    Hmm, I'm not sure what you mean by html view. I don't have that option on my custom page. I built it using Dreamweaver.

  6. SwansonPhotos
    Member
    Posted 4 months ago #

    The PHP code needs to be added to code - not in a visual editor.

  7. moxyma
    Member
    Posted 4 months ago #

    Oh I see. Okay, I put in the code you provided using the admin section of WordPress (Appearance --> WordPress --> Custom page). Doesn't look to be working :(.

  8. SwansonPhotos
    Member
    Posted 4 months ago #

    Custom Page must be a theme option...

  9. moxyma
    Member
    Posted 4 months ago #

    Oh wait Swanson, oh my gosh oh my gosh wait it is working!!! I misunderstood your your code.

    You gave this which is perfect - <?php echo do_shortcode('[shortcode]'); ?>

    So then I have this now -

    <?php echo do_shortcode('[MY SHORTCODE FROM THE PLUGIN]'); ?>

    I was trying to put that in just like you typed it. But then I realized that you have to put in the actual shortcode for the plugin inside of the php code where it says 'shortcode'. LOL

    Oh my gosh thank you so much!!!

  10. SwansonPhotos
    Member
    Posted 4 months ago #

    you are quite welcome

  11. moxyma
    Member
    Posted 4 months ago #

    I hope this helps someone else who may be having the same issue. I'm surprised I didn't see more people asking it. LOL Oh well.

    Thanks again Swanson! Greatly and much appreciated :)

  12. SwansonPhotos
    Member
    Posted 4 months ago #

    Please mark this post resolved and again your are welcome.

Reply

You must log in to post.

About this Topic