James Gehring
Forum Replies Created
-
AuthorPosts
-
This reply has been marked as private.
I will check to see if it works. Thanks
I think that may help, but I need to be able to get the package_id.
I am using MailChimp API to update user group.
Example
The user creates a listing with package_id=1
I use that to tell MailChimp to update the user group to a paid listing.
So yes I need GD info
Thanks, that worked.
I want to have the address show instead of the description.
Thanks for getting back to me so fast. I want to change the content that is on the tab, not the tab title. I included a screenshot.
Awesome, I did have to modify it to work. Now how to get it to work when doing a search.
add_action('pre_get_posts', '_my_geodir_listing_loop_filter', 2); function _my_geodir_listing_loop_filter($query){ if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop'] && !is_admin()) { add_filter( 'posts_where' , '_my_post_exclude_where' ); } return $query; } function _my_post_exclude_where($where) { global $wp_query,$table_prefix; $post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : ''; $post_types = geodir_get_posttypes(); if ($post_type && in_array($post_type, $post_types)){ $where .= " AND ".$table_prefix."geodir_".$post_type."_detail.package_id != 2 "; } return $where; }
Here is the query on the page. You can see that did not make any changes to the query.
SELECT SQL_CALC_FOUND_ROWS iV5L4_posts.*, iV5L4_geodir_gd_place_detail.*
FROM iV5L4_posts
INNER JOIN iV5L4_geodir_gd_place_detail
ON (iV5L4_geodir_gd_place_detail.post_id = iV5L4_posts.ID)
WHERE 1=1
AND ( ( iV5L4_posts.post_title LIKE “” )
OR FIND_IN_SET(275 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(277 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(278 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(279 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(280 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(283 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(287 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(288 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(289 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(291 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(292 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(294 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(295 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(298 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(300 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(302 , iV5L4_geodir_gd_place_detail.gd_placecategory)
OR FIND_IN_SET(303 , iV5L4_geodir_gd_place_detail.gd_placecategory) )
AND iV5L4_posts.post_type in (‘gd_place’)
AND (iV5L4_posts.post_status = ‘publish’)
AND ( FIND_IN_SET(‘275’, iV5L4_geodir_gd_place_detail.gd_placecategory ) )
ORDER BY iV5L4_geodir_gd_place_detail.package_id asc, iV5L4_geodir_gd_place_detail.is_featured asc, iV5L4_posts.post_date desc, iV5L4_posts.post_title
LIMIT 0, 18I unblocked the UK.
Let’s say I haven’t done any customization and just want to exclude listings with a package_id = 2 from the main listings page is there a filter for this? I know with geodir_posts_order_by_sort_my_change you can change the sort option by package_id, but I want to exclude them altogether. I was hoping for an easy solution so I wouldn’t have to do any more custom queries. =)
That plugin is the one I used to help build my custom queries.
Sorry to be a pain.
Thanks,
JamesThis reply has been marked as private.I have built a custom directory that has the listings in tiers. I created custom loops for each plan and left the free one with the original loop. I used a sort filter to make all the free listings come up first, but on some searches, there are not that many listings so the paid listings show up again. If you can point me to the filter that allows me to exclude all but the free packages, that would be great.
Thanks,
JamesHey, Alex thanks so much for your help. A widget won’t work. I would love to have an expert contact me. What do you need from me to make that happen?
This reply has been marked as private. -
AuthorPosts