scamp
Forum Replies Created
-
AuthorPosts
-
I am looking to stop some in page script from caching not a js file. I was wondering if there was any code I could put around a script to stop it caching.
So there is no way I could link to the user table in a filter??
add_filter(‘geodir_posts_order_by_sort’, ‘geodir_posts_order_by_sort_my_change’,10,3);
function geodir_posts_order_by_sort_my_change($orderby, $sort_by, $table){
if($orderby==’ ‘){
$orderby = “$wpdb->users.user_nicename asc, “;
}
return $orderby;
}So where do I edit p“listing title” and “listing description”?
In languagesgeodir-cp-languages or languagesgeodirectory
Thank you.
S
I found this in general_functions.php
I change it to use display_name in stead of nice_name
if(strpos($title,’%%name%%’) !== false){
$author_name = ”;
if($author_name = get_the_author()){}
else{
$queried_object = get_queried_object();
if(isset($queried_object->data->display_name)){
$author_name = $queried_object->data->display_name;
}
$title = str_replace(“%%name%%”,$author_name,$title);
}
}
Thanks – I will test this out tomorrow.
S
Thanks..
thanks
s
Thanks
S
Yes I realise that – and what I am suggesting is that we should be able to have the “listing title” and “listing description” different on CPTs if we want.
It does not make sense in my directory to have the place listing title and event listing title to have the same label.
In the old theme (GeoTheme) – we used to be able to have different field names labels for Places and Events. In wpGeoDirectory we have to use what ever value is set for PLACE_TITLE_TEXT for all CPTs.
So for instance, when I add a new Place in my directory – the Place Title Label on the Add Listing page is called “Gym Name”, and the Place Description Label is “Gym Profile”.
When this Gym goes to add Events – I do not want the Event Title Label and the Event Description to be the same as the Place. I would like to have the Event labels to be different. e.g. Class Name and Class Description.
In the Language.php – there is only a constant for PLACE_TITLE_TEXT we should be able to have different Title Text labels for different CPTs e.g. <%cpt_slug%>_TITLE_TEXT
Forget about this – it just started to work!
April 22, 2016 at 12:01 am in reply to: Filter so that only main listings show on Listings page #168361Got it to work….
add_action( ‘pre_get_posts’, ‘hmf_show_main_franchise_on_listing’ );
/**
* Change gd_place category listing page to only show Main Franchise
*
* @author Sara Wright
* @param object $query data
*
*/
function hmf_show_main_franchise_on_listing( $query ) {if( $query->is_main_query() && !is_admin() && $query->is_post_type_archive(‘gd_place’) ) {
//$query->set( ‘posts_per_page’, ‘3’ );$meta_query = array(
array(
‘key’ => ‘gd_is_franchise’,
‘value’ => ‘1’,
‘compare’ => ‘=’,
)
);
$query->set( ‘meta_query’, $meta_query );}
}
April 21, 2016 at 10:24 pm in reply to: Filter so that only main listings show on Listings page #168339I am happy to do my own code changes, I can see the list view team play file but what I am unsure of is where the sql gets put toe the to bring back all the gd_places.
If I knew which function it was and what file it was in might be able to add in an extra where clause… Or use my own function instead.
Thanks
S
Cool – thanks so much…… be so nice to have a way in the admin area to set a franchise and main listing…
-
AuthorPosts