Custom Loop Event Page
I think It’s complicated so I prefer make an alternative for the organisation of my website. I will create a page futur events and a page past events.
I think It’s complicated so I prefer make an alternative for the organisation of my website. I will create a page futur events and a page past events.
I found a solution which displays the posts ordered by the date value, and also removes the past ones. <div class=”container”> <div class=”row”> <table> <tr> <th>Artista</th> <th>Fecha</th> <th>Ciudad</th> <th>Información</th> </tr> <?php $today = current_time(‘Ymd’); $args = array( ‘post_type’ => ‘evento’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘fecha_del_evento’, ‘compare’ => … Read more
Working code: <?php global $wpdb; $date = date(“Y-m-d”); $querystr = ” SELECT * FROM wp_posts JOIN wp_ftcalendar_events ON wp_posts.ID = wp_ftcalendar_events.post_parent WHERE wp_posts.post_status=”publish” AND wp_posts.post_type=”post” AND wp_ftcalendar_events.start_datetime >= ‘$date’ ORDER BY wp_ftcalendar_events.start_datetime ASC “; $pageposts = $wpdb->get_results($querystr, OBJECT_K); ?> <?php if ($pageposts): ?> <?php global $post; ?> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post); … Read more
In general WordPress posts do not represent continuous process. They and their data capture the state of certain point in time (last edit). While there is a WP Cron mechanism for scheduled and (optionally) recurrent operations, it’s poorly suited for periodic post manipulation. For a large amounts of posts it would take either excessively long … Read more
Admin – Search Events by a custom field
Try adding an id attribute in your button definition: ed.addButton(‘solution’, { disabled: 0,//count_problems(ed).length == 0, id: ‘my_button’, title : ‘Add problem solution’, //cmd: ‘solution_fun’, image : url + ‘/images/wspringer.png’, type: ‘menubutton’, menu: [{text: ‘problem id = ‘ + 1, value: 1}], onselect: function(v1) { ed.windowManager.open({ title: ‘Insert solution in popeye output format’, body: [{type: ‘textbox’, … Read more
you would need to use the date query: $args = array ( ‘cat’ => ‘1234’, // if category being used ‘post_type’ => ‘events’, // if custom post type ‘paged’ => get_query_var(‘paged’), ‘order’ => ‘DESC’, ‘paged’ => $paged, ‘date_query’ => array( // this is the thing you need array( ‘before’ => array( // this is ‘before … Read more
Use a static method – the add_action will fire for each instantiation, but the hook will only be registered once: add_action( ‘wp_enqueue_scripts’, __CLASS__ . ‘::planner_load_scripts’ ); static public function planner_load_scripts() { }
date() PHP functions returns the value of time() PHP functions in the specified format. time() use server local time. If you want to get date/time based of WordPress configuration, you could use current_time(), a WordPress function, instead of native PHP functions. // ‘timestamp’ = Unix Timestamp or ‘U’ PHP time format $current_time = current_time( ‘timestamp’ … Read more
You probably don’t have enough visitors on your site. Although it looks otherwise WordPress doesn’t actually schedule the events. It writes the time when it should happen to the database, and only when somebody visits the site WP gets fired up, checks the database and fires the event. So, if nobody is around at the … Read more