custom field with wysiwyg editor

Home Forums WordPress Theme CityBook – Directory & Listing WordPress Theme custom field with wysiwyg editor

This topic contains 9 replies, has 2 voices, and was last updated by  CTHthemes 2 days, 9 hours ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #33966

    adminb
    Participant

    Supported

    Hi, glad to use your nice theme

    I want to add shortcode in the restaurant listing type via the custom field “editor” in “field” page of listing type editor (not the “unique” page of listing type editor), but when I put the shortcode in custom field when Im in editing page of the restaurant, it doesn’t work (doesn’t appear) in single page of the restaurant therefore it’s working when I put the shortcode in the “description” field which use “wysiwyg editor”

    So how can I add a custom field which work with shortcode?

    thanks

    #33987

    CTHthemes
    Keymaster

    You can use ShortCode element on Single -> Listing sub-tab instead: http://prntscr.com/odz2ei

    #34020

    adminb
    Participant

    Supported

    I want to add different shortcode in each restaurant, how can I declare the shortcode element in field to use when I fill the information for a restaurant?

    #34051

    CTHthemes
    Keymaster

    1 – Add new custom select field for predefined shortcode for select from listing submit: http://prntscr.com/of2k81
    2 – Create new builder element ( or override existing element ) to add your shortcode implement code: http://prntscr.com/of2lig

    
    $custom_shortcode = get_post_meta( get_the_ID(), ESB_META_PREFIX.'custom_shortcode_field_name', true ); 
    echo do_shortcode( "[$custom_shortcode]" );
    

    https://docs.cththemes.com/docs/for-developer/

    #34081

    adminb
    Participant

    Supported

    I did what you said but still not working, the best solution is to show me how to create a “wysiwyg editor” field or to show me how to replace the standard “text” field by a “wysiwyg editor” field.

    the shortcode work in the description field so I just need to duplicate the description field may be..

    (I used a standard shortcode of CF7 just for testing)

    attached picture of what I’ve done until the result

    • This reply was modified 4 days, 21 hours ago by  adminb.
    Attachments:
    You must be logged in to view attached files.
    #34094

    CTHthemes
    Keymaster

    You can’t use shortcode with Custom Field element. You have to create new one element or override existing one. Check links above for detailed documentation.

    #34110

    adminb
    Participant

    Supported

    _ I made the copy of azp_templates folder in my child theme and modified the azp_lcontent.php as you said me to do (picture attached A1 ),

    _ I create a field as you told me but I don’t know (picture attached A2)

    _ But in the single listing editing (picture attached A3) page I don’t know what to add

    please give me a step by step way to add shortcode field in my listings, each shortcode will be different, so like the description field in the listing page (picture attached A4) I need to change values for each restaurant in their editing page

    hope it’s clear
    thank you in advance

    Attachments:
    You must be logged in to view attached files.
    #34125

    CTHthemes
    Keymaster

    Try this: http://prntscr.com/og67tx
    And the shortcode will display on single listing page ( not listing edit page )

    #34145

    adminb
    Participant

    Supported

    Thank you for this correction,
    now it’s working

    Good job!

    #34156

    CTHthemes
    Keymaster

    You are most welcome 🙂

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

You must be logged in to reply to this topic.

New featues: CityBook - Listing & Directory WordPress Theme version 2.1.8 was outUpdate now
+