Custom Fields
Re-Envisioned
Support MB Custom Post Type Display multiple CPT on a map ? FacetWP Map Facet

  • Creator
    Topic
  • #30409
    Resolved tripvendor
    Participant

    Hi - I 'm just starting to plan out what to do, so would appreciate some guidance regarding Business Directory site

    I read your article about displaying on maps.
    I read your blog post about database optimization and structuring tables to scale better (good, thanks).

    I'm not sure what the total listing count will be but it will run into tens of thousands eventually.

    1) does it make sense to separate the listings into different CPT to maintain performance for users searching on keywords (government listings in one CPT, healthcare in another, businesses or points of interest in another?

    2) if there are separate different CPT can they be displayed on the same map using some kind of location parameter?

    3) is Meta Box compatible with FacetWP Map Facet - and would this be the way to go to manage map displays?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #30428
    Long Nguyen
    Moderator

    Hi,

    Thank you for getting in touch. Let me answer your questions.

    1. All CPTs are stored in one table (wp_posts) so I think it does not improve the performance when separating the listings into many CPTs. Just helps you to categorize the type of content.
    2. Yes, it is possible to query multiple post types.
    3.         $query = new WP_Query( [
                  'post_type' => array( 'government', 'healthcare' ),
              ] );

      Read more on the documentation https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters

    4. Unfortunately, FacetWP can't filter by maps. You should make it filter by other fields (cities, wards, etc.), and the map will be displayed accordingly.
    #30433
    tripvendor
    Participant

    great support thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.