Skip Navigation

[Resolved] Embedding code /short code onto product template

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1293483

Hi,

I'm trying to ebed one of these shortcodes (For example <?php echo do_shortcode('[Woo_stamped_io type="widget"]'); ?>)

Onto my product page template, so that it shows up under the 'categories' section.

I thought I'd just be able to insert this as indicated below. But this is not working. Can you tell me what I'm doing wrong?

hidden link

<h1 class="page-title">[wpv-post-title]</h1>
<ol class="breadcrumb">

  • [wpv-post-link id="59"]
  • </ol>

    <div class="card panel panel-default">
    <div class="panel-body">
    <div class="row">
    <div class="col-sm-3">
    [wpv-woo-product-image size='shop_single' output='' enable_third_party_filters='no' gallery_on_listings='yes' class="img-rounded"]
    </div>
    <div class="col-sm-offset-1 col-sm-4">
    Description
    [wpv-post-body view_template="None"]
    <hr lass="divider">
    <dl>
    <dt>Categories</dt>
    <dd>[wpv-post-taxonomy type="resource-category"]</dd>
    </dl>

    <?php echo do_shortcode('[Woo_stamped_io type="widget"]'); ?> (HERE!)

    [wpv-conditional if="( $(wpcf-product-installation-instructions) ne '' )"]
    <div class="well well-sm">

    Instalation instructions

    </div>
    [/wpv-conditional]
    [types field='video-youtube' width='100%' height='auto'][/types]
    </div>
    <div class="col-sm-offset-1 col-sm-3">

    <div class="well well">
    <h3>Get the resource</h3>
    <hr>
    [wpv-conditional if="( '[wpv-current-user]' eq '' )"]
    <p class="lead">To access resources please hidden link">join now or log in.</p>
    [/wpv-conditional]
    [wpv-conditional if="( '[wpv-current-user]' ne '' )"]
    [wcm_restrict plans="member-standard"]
    [wpv-woo-buy-options add_to_cart_text='Add to basket']
    [/wcm_restrict]
    [wcm_nonmember plans="member-standard"]
    <p class="lead">To access resources please hidden link">join now
    [/wcm_nonmember]
    [/wpv-conditional]
    </div>
    [social_warfare]
    </div>
    </div>
    </div>
    </div>

    #1293545

    Hello,

    In views content or content template, you can not use PHP codes directly, but you can use shortcode directly, for example, replace this line from:

    <?php echo do_shortcode('[Woo_stamped_io type="widget"]'); ?> (HERE!)
    

    With:

    [Woo_stamped_io type="widget"]
    
    #1293643
    Screenshot 2019-07-17 at 11.52.58.png

    Thanks, tried that but as per screenshot its still not displaying - not sure if Im missing something?

    hidden link

    #1294289

    It seems that shortcode [Woo_stamped_io type="widget"] does not work in your website.

    Please try to display this shortcode '[Woo_stamped_io type="widget"] directly in post content, make sure it can display something in your website.

    #1294807

    Thanks its working now.

    My final challenges is finding what I presume will be another content template that manages this page listing
    hidden link

    where I'd like to make another short code appear under each of the individual listed items.

    Can you guide me to the correct content template please?

    #1295373

    What is the another custom shortcode?
    How do you setup/create it?

    I have checked the URL you mentioned above:
    hidden link

    It seems to be archive page of taxonomy "resource-category", and I assume you are using Views WordPress archive to customize this page.

    If it is, please edit that Views WordPress archive:
    Dash-> Toolset-> WordPress Archives, find and edit the specific WordPress Archives(ID: 1672), and put your custom shortcode into section "Loop Editor", within view's loop:
    <wpv-loop> ... </wpv-loop>

    More help:
    https://toolset.com/documentation/getting-started-with-toolset/customize-post-archives/designing-an-archive-without-any-page-builder/