Date/time limitation of posts where function must be executed
Date/time limitation of posts where function must be executed
Date/time limitation of posts where function must be executed
Great question, I asked it myself and here’s what I came up with. You can just use this in a custom plugin or in functions.php. // turn on Output Buffering (hence *ob*) ob_start(); // register a callback to run after WordPress has outputed everything add_action(‘shutdown’, function () { // get the output buffer and store … Read more
Yep, of course that’s possible. There are several ways of viewing the php source code of your theme, of your plugins and of WordPress itself. I assume that you are interested in the php code of your theme – that’s mostly what’s generating the public facing HTML that gets served to the site visitor’s browser. … Read more
From the Codex page for $wpdb: The function [$wpdb->query] returns an integer corresponding to the number of rows affected/selected. If there is a MySQL error, the function will return FALSE. So in order to display a success/failure message, it should be a simple matter: $result = $wpdb->query( ” DELETE FROM $wpdb->posts WHERE anything = ‘whocares’ … Read more
The filter responsible for adding these characters is wptexturize, you can remove it using remove_filter. remove_filter( ‘the_content’, ‘wptexturize’ ); remove_filter( ‘the_excerpt’, ‘wptexturize’ );
One way you can handle this would be to do the wp_sprintf when assigning the value of the $message variable and then use wp_kses when you want to output. You could also output the div and paragraph tags before and after the message, which would eliminate the need for wp_sprintf in this instance. add_action( ‘admin_notices’, … Read more
If you are using a child or custom theme, I encourage you to look at the Codex’s Template Hierarchy. The short answer to your question is yes, you can run custom code on any page you’d like. The longer answer is still yes, but it’s a bit more involved in what your end product is … Read more
I hear you. I’ve been very disappointed with almost every theme I’ve ever purchased. That includes multiple Theme Forest themes, one from MOJO, Elegant Themes, and more. The only theme foundry I like is…wait for it, this is so poetic…The Theme Foundry. The quality of their themes is underscored (not to be confused with _s) … Read more
There are problems with this part: ++$GLOBALS[‘wpdb’]->current_post There’s no current_post property of the wpdb class, here you’re most likely confusing the wpdb class with the WP_Query class. Also we wouldn’t want in general to modify the current_post property of the global WP_Query, it could surely “bite us” if we mess with the globals 😉 Note … Read more
There were several errors in your code. The biggest was that the function didn’t even have a closing bracket, but we can probably assume that was just not copied into your post, otherwise nothing would have been working for you. This is a filter on the content right? It looks like you want to append … Read more