willroy
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Simple SEO] google Search Console ErrorDo you know when this will be released? Not really wanting to but may have to look for alternative plugin :/
Forum: Plugins
In reply to: [Loco Translate] Adding Plural & SingleOk going over the process again, I was skipping saving the master .POT after running the sync with source code.
Ok I ended up adding my own filter, here it is if anyone needs or need to add their own shortcodes that work in the EM Event scope:
#_EVENTDAYS
returns “x day(s)”
#_EVENTSTARTDATE
returns event_start_dateadd_filter('em_event_output','mc_em_event_output',10,4); function mc_em_event_output($event_string,$obj,$format,$target) { //Now let's check out the placeholders. preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $event_string, $placeholders); $replaces = array(); foreach($placeholders[1] as $key => $result) { $match = true; $replace = ''; $full_result = $placeholders[0][$key]; switch( $result ){ case '#_EVENTDAYS': // Return number of days if( $obj->event_start_date != $obj->event_end_date){ $replace = floor(($obj->end - $obj->start)/(60*60*24)) + 1 . ' days'; }else{ $replace = 1 . ' day'; } break; case '#_EVENTSTARTDATE': // Return event start date $date_format = ( get_option('dbem_date_format') ) ? get_option('dbem_date_format'):get_option('date_format'); if( $obj->event_start_date != $obj->event_end_date){ $replace = date_i18n($date_format, $obj->start); } break; default: $replace = $full_result; break; } $replaces[$full_result] = apply_filters('em_event_output_placeholder', $replace, $this, $full_result, $target); } //sort out replacements so that during replacements shorter placeholders don't overwrite longer varieties. krsort($replaces); foreach($replaces as $full_result => $replacement){ if( !in_array($full_result, array('#_NOTES','#_EVENTNOTES')) ){ $event_string = str_replace($full_result, $replacement , $event_string ); }else{ $new_placeholder = str_replace('#_', '__#', $full_result); //this will avoid repeated filters when locations/categories are parsed $event_string = str_replace($full_result, $new_placeholder , $event_string ); $desc_replace[$new_placeholder] = $replacement; } } return $event_string; }
Ahhh – #_EVENTNOTES
in the “Single event page format” area? I can not see a shortcode tag that you can use for the post_content of a page?
Andddd answered my own question again:
<?php echo print_r(EM_Events::get($post->ID)) ?>
Forum: Plugins
In reply to: custom post type with post_id in permalink structureI’ve got as far as displaying the links with the CPT entry name however it’s returning a 404 not found when clicked on:
// Create a rewrite rule for the Vacancies CPT so that ID numbers can also be used:
add_action('init', 'vacancies_rewrite'); function vacancies_rewrite() { global $wp_rewrite; $queryarg = 'post_type=vacancies&p='; $wp_rewrite->add_rewrite_tag('%cpt_id%', '([^/]+)', $queryarg); $wp_rewrite->add_permastruct('vacancies', '/vacancies/%cpt_entry%/%cpt_id%', false); }
// Now hook the post_type_link filter
add_filter('post_type_link', 'vacancies_permalink', 1, 3); function vacancies_permalink($post_link, $id = 0, $leavename) { global $wp_rewrite; $post = &get_post($id); if ( is_wp_error( $post ) ) return $post; $newlink = $wp_rewrite->get_extra_permastruct('vacancies'); $newlink = str_replace("%cpt_id%", $post->ID, $newlink); $newlink = str_replace("%cpt_entry%", $post->post_name, $newlink); $newlink = home_url(user_trailingslashit($newlink)); return $newlink; }
Forum: Plugins
In reply to: custom post type with post_id in permalink structuredpchen, thanks for that, really useful..
How could I modify that so I could include the post’s slug AS WELL as id i.e:
https://url.com/myposttype/this-is-a-custom-post-type-entry/12
or
https://url.com/myposttype/this-is-a-custom-post-type-entry-12
or
https://url.com/myposttype/12-this-is-a-custom-post-type-entry
Whichever is easiest?
Thanks for any suggestions
OK I did clean install of plugin including deleting the tables in the DB and it’s sorted.. must have got a bit corrupt or the upgrade from 1.4 – 1.7.2 did something? Cheers anyway.
I was on wp 3.03, but have now upgraded to 3.04, with still no luck and yes – I’m running 1.7.2 of My Calendar.
Interestingly enough I’ve just noticed that the event information are not not displaying in the my_calendar output.. just an empty box appears when the days is clicked on where there would normally be the event info..
I think I will delete the plugin files and re-install to see if that changes things..
Ok this error message goes once you enter the Highrise creds. As a tip, an info box letting me know this would help!
Forum: Requests and Feedback
In reply to: Subcategories for Linksthirded
Forum: Alpha/Beta/RC
In reply to: When is the 2.8 version release?I am looking forward to seeing what the new theme / plugin editor looks like;
So! 10, 9, 8, 7, 6, 5, 4, 3, 2 …
Forum: Fixing WordPress
In reply to: how to query database?$wpdb->get_results returns an array so you wanna loop the results out:
$pageposts = $wpdb->get_results($sql, ARRAY_N);
while($row = mysql_fetch_array($pageposts)) {echo $row[‘fieldname’];
}
Forum: Fixing WordPress
In reply to: creating several static pages menu linksInstead of creating a new post, create a new page instead.