The post_type value is blank in query_vars for geodirectory-archive.php

This topic contains 6 replies, has 3 voices, and was last updated by  Alex Rollin 4 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #542504

    Aleks Szymanski
    Free User
    Post count: 23

    I have 3 post types created in GeoDirectory:

    1. gd_place
    2. gd_event
    3. gd_people

    I’m customizing geodirectory-archive.php for category pages and I’m having trouble getting the “post_type” value from query_vars for gd_people category pages. It works for gd_place and gd_event category pages, but not gd_people. Here’s example:

    1. People (gd_people) > Coaches – https://tennisletics.com/explore/people/category/coaches/
    2. Place (gd_place) > Resorts – https://tennisletics.com/explore/places/category/resorts/

    Notice when you inspect code, the body classes are slightly different indicating the use of different template:

    1. People category – “tax-gd_peoplecategory term-coaches term-166”
    2. Place category – “post-type-archive post-type-archive-gd_place”

    In summary, it looks like Place and Event categories are displaying as post type archives, but People categories are displaying as taxonomy archives.

    Anyway I can make People category pages display like Places and Event category pages; post type archive rather than taxonomy archive?

    #542523

    Alex Rollin
    Moderator
    Post count: 27815

    post-type-archive-gd_people is missing, this is the issue?

    You are trying to make a single archive for all 3?

    Can you post your code?

    #542983

    Aleks Szymanski
    Free User
    Post count: 23

    Sorry if I wasn’t clear. In “geodirectory-archive.php”, I need to get the “post_type” from query_vars:

    $post_type = $wp_query->query_vars['post_type'];

    This works for gd_placecategory and gd_eventcategory, but not gd_peoplecategory.

    Event Category – https://tennisletics.com/explore/places/category/resorts/
    Place Category – https://tennisletics.com/explore/events/category/camps/
    People Category – https://tennisletics.com/explore/people/category/coaches/

    The “post_type” key returns blank from query vars for People Category.

    #543217

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Aleks,

    I checked on other sites of my local. unable to reproduce the case.
    So seems like this issue is site-specific and can cause by plugin conflicts or any of the GD plugin which is not updated.

    Please share site details and FTP in a private reply. so we can have a look.

    Regards
    Naveen

    #543298

    Aleks Szymanski
    Free User
    Post count: 23
    This reply has been marked as private.
    #543302

    Naveen Giri
    Moderator
    Post count: 1559

    Please also share the site details.

    Thanks

    #543337

    Alex Rollin
    Moderator
    Post count: 27815

    You can also send this info in to our new email support system:

    https://wpgeodirectory.com/support/

    WordPress Credentials
    WP Admin Login URL:
    WP Admin Username:
    WP Admin Password:

    FTP Credentials
    FTP Host:
    FTP Port:
    FTP User:
    FTP Password:
    TLS/SFTP:

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount