dwaber
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [GeneratePress] Only first loop items will be printedOkay, you are right. It is a browser problem combining with the theme. With chrome or opera, it doesn’t work. With Firefox it is okay.
So I have to use Firefox in this case.
Thanks for your help.Forum: Themes and Templates
In reply to: [GeneratePress] Only first loop items will be printedOf course: Here it is: https://chk.me/3yCN02R
Thanks for your precious snippet. That’s exactly what I need.
I had just to concatenate the string $ret on line 6 to follows:
$ret = $ret . $EM_Category->output("#_CATEGORYNAME") . " ";
Now the complete code looks like this:
add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3); function my_em_styles_placeholders($replace, $EM_Event, $result) { if ( preg_match( '/#_EVENTCATEGORIESTEXT.*/', $result ) ) { $ret = ""; foreach($EM_Event->get_categories() as $EM_Category) { $ret = $ret . $EM_Category->output("#_CATEGORYNAME") . " "; } $replace = $ret; } return $replace; }
Actually, I’m searching for a shortcode like #_EVENTCATEGORIES but without any style, no list item and no href and so on, just the category names.
Thanks for your fast reply. Your suggestion shows me all categories. But I just want to show all categories, which belongs to this event.
My code is not typo. I use this to filter them in a list view.
Thanks for your help. It works great!
You made my day!
The last one is now working, but I don’t understand everything on this snippet. It seems, that the missing $meta_query has to be initialized first.
So here is my code, which is working now:function my_custom_query_filter($query) { $current_date = current_time('Y-m-d'); // Set the post type to post. $query->set('post_type', 'event'); // Get current meta Query $meta_query = $query->get( 'meta_query' ); // If there is no meta query when this filter runs, it should be initialized as an empty array. if ( ! $meta_query ) { $meta_query = []; } // Append our meta query $meta_query[] = [ 'key' => '_event_start_date', 'value' => $current_date, 'compare' => '>=', ]; $query->set( 'meta_query', $meta_query ); $query->set('meta_type', 'DATE'); $query->set('orderby', 'meta_value'); } add_filter('elementor/query/future_events', 'my_custom_query_filter');
I’m struggling with the code above. I’d like to have future events in an elementor pro carousel loop together with events manager free version.
When I use your code above and I modified it to filter with current_date:// Create a custom query filter. function my_custom_query_filter($query) { $current_date = current_time('Y-m-d'); // Set the post type to post. $query->set('post_type', 'event'); // Set the meta key to _event_start_date. $query->set('meta_key', '_event_start_date'); // Set the meta type to DATE. $query->set('meta_type', 'DATE'); // Set the orderby to meta_value. $query->set('orderby', 'meta_value'); // Set the order to DESC. $query->set('order', 'DESC'); $query->set( 'meta_compare', '>='); $query->set( 'meta_value', $current_date); // Return the query. return $query; } // Add the custom query filter to the Elementor Pro post widget. add_filter('elementor/query/future_events', 'my_custom_query_filter');
I don’t know, what is wrong with it, but I can’t see any filter function in it. Maybe you can have a look at this?
Sorry, it was not the code. I just set all past events to draft, then it worked for me.
Now, it seems to work.
I called the query_id parameter: my_events
Then the code with a snippet in php was as follows:
add_action(‘elementor/query/my_events’, function($query) {
if ( is_post_type_archive( ‘event’ ) && $query->is_main_query() ) {
$query->set( ‘meta_key’, ‘event_start_date’ );
$query->set( ‘orderby’, ‘meta_value_num’ );
$query->set( ‘order’, ‘ASC’);
$query->set( ‘meta_query’, array(
array(
‘key’ => ‘event_start_date’,
‘compare’ => ‘>=’,
‘value’ => date(‘Y-m-d’),
‘type’ => ‘DATE’,
)
) );
}
});Yes, I have now a new chance! Thanks.
Thanks for your reply,
I could delete events manager and reinstall again without loss of data.But I still have my old format. Id like the format of the demo page. Is this available somewhere?
Forum: Plugins
In reply to: [Simple Custom CSS Plugin] Error after update to php8.xWhen I expand the code from
$thumb_url = $thumb[‘0’]; to
$thumb_url = $thumb[‘0’] ?? null;
and also the next two lines:
$thumb_width = $thumb[1] ?? null;
$thumb_height = $thumb[2] ?? null;Then it works again.
I don’t know, if this is the right way. But could you fix this in the code?
Forum: Plugins
In reply to: [Leaflet Map] marker color with shortcodeThanks for your fast reply.
Is there a way to set this as default marker. Or in other words: Can I overwrite the default shortcode with this options, that I can have always this new marker as default (apply a filter).
Something like this:
function my_default_marker( $marker ) { $marker = array( 'shape' => 'square', 'color' => 'green-light', 'icon' => 'fa-walking', 'iconColor' => 'white', ); return $marker; } add_filter('leaflet_default_marker', 'my_default_marker', 10, 1);
Forum: Plugins
In reply to: [Simple Custom CSS and JS] How to register Script for ajaxThanks a lot for your help! Now I can finally use code snippet and your plugin together ??