Custom tags in textarea not working

This topic contains 6 replies, has 2 voices, and was last updated by  Paolo 10 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #13800

    Adam
    Buyer
    Post count: 88

    Hi,

    i bought this plugin http://www.wpsimplebookingcalendar.com/ because i need a simple availability calendar. The problem is – i dont know how to insert it into a custom field – textarea (or should i use some other custom field?). For example i have this code from the plugin that i should insert in any field:

    [wpsbc id=”2″ title=”no” legend=”yes” dropdown=”yes” start=”1″ display=”1″ language=”en” month=”0″ year=”0″ history=”1″ tooltip=”no” weeknumbers=”no”]

    It doesnt display it. It doesnt recognize the tags. When i enter this code as a post or page, it works fine. How can i get this one working?

    Thanks!

    #13816

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    That is not a GeoDirectory limitation unfortunately. It is WordPress that doesn’t execute shortcodes in custom fileds. There would be a workaround, but there are actually easier solution without using custom fields at all.

    Where do you have to add that shortcode and is it the same shortcode for all listings?

    Because in that case it would be easier to use the do_shortcode() function to add it using a hook via functions.php file.

    If you give us more detail we will give you more info.

    Thx

    #13818

    Adam
    Buyer
    Post count: 88

    Hi Paolo,

    thanks again for the absolutely superb support.

    I will add this shortcode manually to various listings and it will be always another shortcode (for every listing i need another calendar, so the ID parameter will change), but it would good if it would be visible only in the backend and not in the frontend. Basically that i can go to the backend and add that shortcode to those listing i want to (only to hotels that will pay for this availability calendar). If thats not possible, then we can do it some other way.

    Thanks!

    #13821

    Paolo
    Site Admin
    Post count: 31211

    This is how I would do it.

    1) Avoid using GD custom field and use regular WordPress custom fields.

    Example add the shortcode in the backend in a custom field named htl_calendar only to the listings that need the calendar.

    2) Once we have the shortocode saved for each listing we will use this php snippet to echo the calendar where you need it using a hook:

    echo do_shortcode(get_post_meta(get_the_ID(), 'htl_calendar', true));

    Let us know where you wanted it and I’ll try to provide the complete code.

    Thx

    #13823

    Adam
    Buyer
    Post count: 88

    The first step is clear to me, but could you be a little bit more specific with the second step? Where should I add that php snippet?

    Basically i would like to have it to show up somewhere in the detail of the listing (doesnt matter where).

    Edit – ah, i havent seen the last sentence. So yeah, basically i would like it in in the detailed listing at the end of the profile.

    #13875

    Adam
    Buyer
    Post count: 88

    I figured it out… i am using a widget + a plugin which lets me edit the widget for every listing…

    #13952

    Paolo
    Site Admin
    Post count: 31211

    Excellent! I was going to write some code, but a back end solution is always preferable.

    I’ll set this as resolved.

    Thx

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount