[FIELDS] – how to remove Country/State but keep Address

  • Jonathan
    Jonathan
    Newbie 6 points
    April 23, 2015 at 5:52 pm

    In my [FIELDS], I want to show “Address”, but not show “County, State/Province, distance” (see attached pic).

    Following How to Hide Certain Fields in the Display Section, I tried various hide=”…”, but that didn’t work:
    [FIELDS hide=”address”] – hide all the above, including Address that I want to show
    [FIELDS hide=”distance”] – hides nothing, even distance shows up!

    The question Remove Links to Categories suggests an ugly hack removing table rows in client-side script. It does work, but introduces another problem: Some listings don’t have a “Web Site” field, and then the hack removes the wrong lines. I guess I could hack further, but it’s hardly a maintainable solution…

    Attachments:
    You must be logged in to view attached files.
  • Jonathan
    Jonathan
    Newbie 6 points
    April 23, 2015 at 6:19 pm

    I also tried:
    [FIELDS show="phone|url|map_location|category"]
    It does show the correct fields. But, the field names don’t display correctly – no friendly name (“url” instead of “Website Link”), not bold, no special features like tel: link.


  • Josh
    Super Guru 13,875 points
    April 24, 2015 at 8:13 am

    Hello Jonathan
    Try this [FIELDS hide=”country|state”] for the address we will have to use some script.You can refer here on how to do this (not the same topic but same code and process) >>https://www.premiumpress.com/forums/topic/remove-links-to-categories/

  • Jonathan
    Jonathan
    Newbie 6 points
    April 25, 2015 at 7:27 am

    Thanks.
    [FIELDS hide="country|state"] doesn’t work – hides nothing.

    I ended up using the hacked script you link to, but with nth-last-child to avoid the problem described in my original post.


  • Josh
    Super Guru 13,875 points
    April 25, 2015 at 9:59 am

    Thanks for sharing.

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

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes