• vaschops

    (@vaschops)


    Hi…

    I am trying to make some customization to a website but I am not very keen with PHP.

    Theme developer advised which file to edit and I think I found the code I want to change.

    Basically, it is a directory theme with pins on the map. Each pin pops up an info window which displays among other stuff the location. The thing I want it to show the last-child of the location category instead of the parent.

    The website and the map can be found at http://greenleafmaps.info/golocal-network/

    The code is the following:

    $javo_result	= Array(
    ‘state’	=> ‘success’
    , ‘post_id’	=> $post->ID
    , ‘post_title’	=> $post->post_title
    , ‘permalink’	=> get_permalink( $post->ID )
    , ‘thumbnail’	=> $javo_this_thumb
    , ‘category’	=> $javo_meta_query->cat(‘item_category’, __(‘No Category’, ‘javo_fr’))
    , ‘location’	=> $javo_meta_query->cat(‘item_location’, __(‘No Location’, ‘javo_fr’))
    , ‘phone’	=> get_post_meta( $post->ID, ‘jv_item_phone’, true )
    , ‘website’	=> esc_url( get_post_meta( $post->ID, ‘jv_item_website’, true ) )
    , ’email’	=> sanitize_email( get_post_meta( $post->ID, ‘jv_item_email’, true ) )
    , ‘address’	=> get_post_meta( $post->ID, ‘jv_item_address’, true )
    , ‘author_name’	=> $javo_this_author->display_name
    );

    I am not sure if this can be done by just changing this one line of code …but my question is what should I put in the ‘location’ array in order to show the last-child of the location instead of the parent..?

    If this is not the right place to seek help for such issues…can u advice where?

    Kind thanks.

    Vas

  • The topic ‘Show location sub-category instead of main location category’ is closed to new replies.