TheodorGr
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Google Review Slider] slider row in mobileGreat! Thanks!
Forum: Fixing WordPress
In reply to: Redirection after error in installingOh my…
That was it.
Thanks a lot!
Forum: Fixing WordPress
In reply to: Redirection after error in installingIm sorry but they dont help actuallly.
Here is my subdomain
deletedwhere I made the error during installation of wordpress.Right now, the folder in the server (public_html/shop) is empty.
I want to stop it from redirecting todeleted.Thanks!
Since there seems to be no way to resolve the issue… how could I “construct” a simple google maps URL to display in my events (instead of using the embed map)?
Thanks for any suggestions
- This reply was modified 8 years, 6 months ago by TheodorGr.
The problem is the wordpress template I use has ajax loading as a feature so I am not really sure how it does what it does. I surely know that the header and footer sections are not refreshed when you visit a page, and ajax just changes (loads) the content (and of course changes the URL to display the “new” URL as if the page had been changed). I suspect whatever script is therefore designed to be loaded in the header or footer sections, is not being reloaded when I visit a page.
I dont know if this info helps, but for example I had the same problem with “add to any” share buttons (the buttons wouldnt show up when visiting a page fetched with ajax) but managed to overcome it by adding
a2a.init(‘page’) in the javascript that provides ajax functionality and everything works now. Ideally Id need a similar function for google maps but this is as far as I have gone.Yes, the maps are loaded correctly when a page is manually refreshed by the browser or when it is the first ever page visited.
Thank you for your suggestion. I tried it but it didnt work… Dont know if “enqeueing” the script above would work…although I suspect this is already done anyway.
Posting to mark this topic as “resolved”.
Thanks for confirming…I actually dived into the functions of my theme, found the cb_get_qry() function and edited that instead – I believe this to be a more elegant solution, which by the way I found by searching a bit in these forums. Im posting here for others looking to do a similar thing:
if ( 'event' == get_post_type() ) { $cb_featured_qry = array( 'post_type' => 'event', 'cat' => 'events', 'post_status' => 'publish', 'meta_query' => array( 'key' => '_end_ts', 'value' => (current_time('timestamp') - 14400), 'compare' => '>=', 'type'=>'numeric' ), 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_key' => '_end_ts', 'meta_value' => (current_time('timestamp')-14400), 'meta_value_num' => (current_time('timestamp')-14400),'meta_compare' => '>=' ); } else { // the custom query args my theme had } $cb_qry = new WP_Query( $cb_featured_qry );The above arguments, make the query return “event” posts ordered by their “end” timestamp ONLY if the end timestamp is 4 hours earlier than “now” thus in my frontend the “events” which have “ended” 4 hours ago, are not displayed.
Found a solution for my second issue:
I edited some of my themes functions and included this:
if (in_category('events')) { global $post; $EM_Event = em_get_event($post->ID, 'post_id'); $EM_dates = $EM_Event->output('#_{j F Y}'); // do stuff here.... }Which helps me retrieve the “correct” start date of the event. So consider my second question as solved.
Thank you for your reply – but I am not using the simple lists provided by the plug in due to the fact that I prefer the post styles of my theme.
I managed to edit my theme’s category.php though to achieve excluding “past” events.
I had in category.php
$cb_qry = cb_get_qry(); if ( $cb_qry->have_posts() ) : while ( $cb_qry->have_posts() ) : $cb_qry->the_post(); $cb_post_id = $post->ID;And added after that:
if (in_category ('events')){ $postDate = strtotime(get_the_time("Y-m-d", $cb_post_id )); $todaysDate = strtotime("yesterday"); if ( $postDate <= $todaysDate){ continue; }Which kills the “while” iteration when the post date (event date) is older than yesterday.
But I really needed some guidance as to whether there is a better way to accomplish the same thing (less resource hungry, or generally more “approved” way of doing things).
Similarly I dont mind editing my theme’s functions – php files, in orde to achieve what Im after for my second question.
Sorry double post!
The custom post type was being registered by a plug in with an option to display the custom posts via its own templates. I created per WordPress instructions a single-{post-type}.php file in my theme and cofigured the plug in accordingly, and everything started working.
Thanks!
Thanks – sorted.
Forum: Fixing WordPress
In reply to: wp-comments-post.php BLANK – fresh installActually, its not a blank page….My browser comes up with a an error that there is a disconnection with the page.
Here is the URL so you can see the error, just try to comment on the post