Fields Shortcodes


  • Steve
    Newbie
     
    16 points

    Hello, I have added some [FIELDS] shortcodes to my content-single-listing-directory.php page which I believe is right(please correct me if not), but they do not display on the listing page apart from the category it is in.

    Do you know why this is?
    I have attached a picture of the code on the .php page and the listing page using that code.

    Thank you very much in advance!
    -Ste

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


    Steve
    Newbie
     
    16 points

    I am also using the database keys in the [FIELD] values…



    Steve
    Newbie
     
    16 points

    It is now displayed like the following, I’m not sure why some location info has now appeared:

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

    JamesD
    JamesD
    Elite Member
     
    554 points

    Hello Steve,

    Try removing the hide”” portion at the end of all the FIELDS.



    Steve
    Newbie
     
    16 points

    Hi james thanks for the reply! I have now removed the hide”” section at the end of FIELDS but the output is still the same :(

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

    JamesD
    JamesD
    Elite Member
     
    554 points

    Ok, if pulling a specific field, then just use brackets around the custom field database key. So, for example, if ‘state’ is the database key for your “State” custom field then you would use [state]
    Note: the database key used is CaSE senSiTivE.

    To help you get started:

    <h2><b>Operator Details:</b></h2>
    [category]
    [supphone]
    [supemail]
    <br />
    <h2><b>Location:</b></h2>
    [state]
    [city]
    [businessurl]
    [businessphone]
    [address]
    [openhours]
    <br />

    Try those first to make sure it’s displaying.

    Also, You should change your ‘</br> tags to ‘<br />’ or ‘<br>’

    This reply was awarded the best answer by the topic poster.


    Steve
    Newbie
     
    16 points

    Thank you so much James that was worked perfect! & Thank you kindly for the <br> tip 😀


    JamesD
    JamesD
    Elite Member
     
    554 points

    You’re welcome Steve, glad to help. My apologies for not catching it quicker.

    Thanks for updating!


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

You must be logged in to reply to this topic.