• Resolved simonsteed

    (@simonsteed)


    Is there a way to pull out specific fields? In my case, I need to pull the phone number for the current location to display in the header, cannot see how this is done?

    Thanks

    Simon

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter simonsteed

    (@simonsteed)

    Found out I can use the following:

            	<?php echo do_shortcode("[contact-card show_map=0 show_name=0 show_address=0 show_get_directions=0 show_phone=1 show_contact=0 show_opening_hours=0]"); ?>
    

    However it’s injecting it’s own markup, guess I need to customise the template ??

    Hi @simonsteed,

    There are also some helper functions you can use. Look at the Helper Functions section on the developer documentation:

    https://doc.themeofthecrop.com/plugins/business-profile/developer/templates

    When using this in your theme , I recommend you check that the function exists first, to prevent fatal errors if you deactivate the plugin:

    
    <?php if ( function_exists( 'bpfwp_setting' ) ) : ?>
      <?php echo bpfwp_setting( 'phone' ); ?>
    <?php endif; ?>
    
    • This reply was modified 7 years, 11 months ago by NateWr.
    Thread Starter simonsteed

    (@simonsteed)

    Brill – thanks Nate.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I just pull the phone number?’ is closed to new replies.