custom field with wysiwyg editor

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

This topic contains 13 replies, has 3 voices, and was last updated by  CTHthemes 2 months, 2 weeks ago.

Viewing 14 posts - 1 through 14 (of 14 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 months ago by  adminb.
    #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

    #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 🙂

    #35441

    Br4in5t0rm
    Participant

    Supported

    Hi,

    I am also trying to create an additional WYSIWYG for one of my listing types and this post is helpful, but I dont understand, which one to choose to create this field? https://prnt.sc/oyxkcy

    #35466

    CTHthemes
    Keymaster

    Try Rich Text Editor field.

    #35473

    Br4in5t0rm
    Participant

    Supported

    https://prnt.sc/oz4njx – That was the first thing I tried but the Rich Text Editor custom field does not have a Name field to refer to in Single Listing Page builder

    #35496

    CTHthemes
    Keymaster

    You will find its name from front-end submit page: https://prnt.sc/ozfay4
    Righ click then select Inspect context menu

Viewing 14 posts - 1 through 14 (of 14 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
+