Connection back-end to listing page

Home Forums WordPress Theme CityBook – Directory & Listing WordPress Theme Connection back-end to listing page

This topic contains 26 replies, has 3 voices, and was last updated by  Aron Verhoeven 3 days, 18 hours ago.

Viewing 25 posts - 1 through 25 (of 27 total)
  • Author
    Posts
  • #35563

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    I’ve created an Custom Number in mu Listing Type. See: https://prnt.sc/p00jyn. So when the user fills in the form, it looks like this: https://prnt.sc/p00kr2. So that works.

    However, I can’t make any connection with the back-end, to the listing page. How can I add this information to the Single listing page? So to: https://prnt.sc/p00lbr, that it is visible on the listing page?

    Thanks in advance.

    Kind Regards,
    Aron Verhoeven

    #35611

    CTHthemes
    Keymaster

    Use Custom Field element on single listing builder:
    And use name of your field in Field Name field:
    https://prnt.sc/p12wo5
    https://prnt.sc/p12xdp

    #35612

    CTHthemes
    Keymaster

    Use can also use this php code to get the field info ( on template .php file )

    get_post_meta( get_the_ID(), ESB_META_PREFIX.'YOUR_CUSTOM_FIELD_NAME_HERE', true )

    #35654

    Aron Verhoeven
    Participant

    Supported

    Thanks, that worked. Used the php code to show it in the Contact Widget: https://prnt.sc/p18x2z

    For people who would like to know how: https://prnt.sc/p18ym6.

    #35676

    Br4in5t0rm
    Participant

    Supported

    Hey Aron, may I ask? Which plugin and widget you used for Google Ads on listing page please?

    Your site looks great!

    #35677

    Aron Verhoeven
    Participant

    Supported

    Hi Br4in5t0rm,

    I use Head and Footer code. I placed my Google AdSense code (and Google Analytics) in the header, and had setup the ads with Raw HTML widgets.

    Google Adsense is providing the code, within the Adsense area.

    Just searching for an way to place the code in the header of the website itself, so I don’t need to make use of an plugin for that.

    Thanks!

    #35703

    Br4in5t0rm
    Participant

    Supported

    Thanks for this solution. It’s so simple. Much appreciated

    #35839

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    Wondering if it is possible to add more Custom Fields in one new widget? Could this be done with Raw HTML?

    I would like to create an new widget for paying clients, with some more extra information fields (like numbers, and some text, which have to be provided by the creator of the listing).

    I used the code above to insert it in the Widget Contact, but now I’m curious if it is possible to add more Custom Fields, into one new widget, which I can hide for non-paying clients.

    Thanks for your answer and enjoy your weekend.

    Kind Regards,
    Aron Verhoeven

    #35854

    CTHthemes
    Keymaster

    Hello Aron, check this doc: https://docs.cththemes.com/docs/for-developer/

    #35944

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    Thanks for reffering me to that link.

    I’ve tried to set it up, however, I think I am still missing something.

    I have copied the text on the picture (https://docs.cththemes.com/docs/for-developer/extend-azp/, under Element 1). I’ve made an new code (called test.php), see: https://prnt.sc/p3pyh5, and placed it in my childtheme.

    How can I go on? What are my next steps? For now I am just trying to insert this widget into the backend of the listing type, so I can change it later. I think I have to import the Shortcode widget? And than? Which classes do I have to use?

    Thanks in advance.

    Aron Verhoeven

    #35945

    Aron Verhoeven
    Participant

    Supported
    This reply has been marked as private.
    #35984

    CTHthemes
    Keymaster

    The azp_shortcode element already exists, then your code will only override it. So please try with other name.

    #36044

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    I’ve made an new name: $new_elements[azp_newshortcode]. See: https://prnt.sc/p4hfmh. I placed this file in my childtheme.

    Also made an php script, called azp_newshortcode.php (see: https://prnt.sc/p4hfld) and placed it in /azp_templates/.

    Can you discover what I am doing wrong?

    #36089

    CTHthemes
    Keymaster

    You are right. But you should change its name and category to make sure you select right element: https://prnt.sc/p50a6a

    • This reply was modified 1 week, 1 day ago by  CTHthemes.
    #36109

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    Ah okay! I’ve changed the code to: https://prnt.sc/p524uw

    However, it is still not visible in the widget list. Is there something I’m missing? What should I do with the __-fields?

    Thanks in advance.

    #36115

    CTHthemes
    Keymaster

    Just change texts inside __( function: https://prnt.sc/p53x0x

    #36116

    CTHthemes
    Keymaster

    https://developer.wordpress.org/reference/functions/__/

    #36119

    Aron Verhoeven
    Participant

    Supported

    Thanks for your reply. Do you maybe have an example? So I can copy it and make my own style of widget?

    I’ve made an change, but it doesn’t work yet… Don’t know what I am missing..

    https://prnt.sc/p566u8

    #36132

    CTHthemes
    Keymaster

    Try this:

    
    $new_elements['azp_newshortcode'] = array( 
        'name'                  => __('New Shortcode','citybook-add-ons'), 
        'desc'                  => __('Custom element for adding third party shortcode','citybook-add-ons'),   
        'category'              => __("content",'citybook-add-ons'),
        'icon'                  => ESB_DIR_URL .'assets/azp-eles-icon/text-block.png',   
        'open_settings_on_create'=>true,
        'attrs' => array (
            array(
                'type'                  => 'textarea',  
                'param_name'            => 'content',
                'label'                 => __('Shortcode Content','citybook-add-ons'), 
                'show_in_admin'         => true,
                'desc'                  => '',
                'default'               => '',
                'iscontent'             =>'yes'
            ),
            array(
                'type'                  => 'text',
                'param_name'            => 'el_id',
                'label'                 => __('Element ID','citybook-add-ons'),
                'desc'                  => '',
                'default'               => ''
            ),
            
            array(
                'type'                  => 'text',
                'param_name'            => 'el_class',
                'label'                 => __('Extra Class','citybook-add-ons'),
                'desc'                  => __("Use this field to add a class name and then refer to it in your CSS." ,'citybook-add-ons'),
                'default'               => ''
            ),
            
        )
    );
    
    
    #36155

    Aron Verhoeven
    Participant

    Supported

    Seems not working.. Can’t discover what I am doing wrong, the widget is not showing up in the Select Element Sidebar.

    #36156

    Aron Verhoeven
    Participant

    Supported
    This reply has been marked as private.
    #36180

    CTHthemes
    Keymaster

    You have to require test.php file from functions.php file to make it work: https://prnt.sc/p6ow35

    require_once dirname( __FILE__ ) . '/test.php';

    #36189

    Aron Verhoeven
    Participant

    Supported

    I’ve added the code in the functions.php in my childtheme. However, I can’t access my WP Admin anymore..

    https://prnt.sc/p6paxa
    https://prnt.sc/p6pbqh

    #36191

    CTHthemes
    Keymaster

    Your code missing this: https://prnt.sc/p6pe0z
    Check it again.

    #36194

    Aron Verhoeven
    Participant

    Supported

    Added that code, however, things are now messy on the website:

    https://prnt.sc/p6pjhp
    https://prnt.sc/p6pj6s

Viewing 25 posts - 1 through 25 (of 27 total)

The topic ‘Connection back-end to listing page’ is closed to new replies.

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