Richard
Forum Replies Created
-
Forum: Hacks
In reply to: Adding a button without submitting the form using the options apiTry this:
<button type="button" onclick="javascript: addUser();">Add/Remove</button>
Forum: Hacks
In reply to: Creating a script rungs a function on every postYou can’t access a javascript function through php in that fashion. You can try to find the php code for the pin that gets run when saving the post, and place that, or a call to it, in your ‘my_ffmpeg_fun’ function.
I would strongly suggest that you contact the author of the theme, or plugin, that is giving the map pin functionality, and ask them how to do it. Failing that, find someone who has php/wordpress experience and ask them to look at it for you. WordPress is very complex, and it is possible you could fubar your site if you’re not careful.
Forum: Hacks
In reply to: Can I override a theme file from my plugin?You should be able to change it using the ‘comments_template’ filter. Something like this might work for you:
add_filter('comments_template','replace_comments_php'); function replace_comments_php($template) { return $path_to_new_comments_php_file; }
Be aware this will only work if the theme is using get_template_part(‘comments’);
Forum: Hacks
In reply to: Extending the SearchForum: Hacks
In reply to: display related post by taxonomyYou don’t want to use get_the_term_list(). Use get_the_terms() instead.
Take a close look at https://codex.www.ads-software.com/Class_Reference/WP_Query.Your query probably needs to look something like this:
$args = array('post_type' => 'sculptures', 'post__not_in' => array($post->ID), 'tax_query'=>array(array('taxonomy'=>'artist', 'field'=>'slug', 'terms'=>get_the_terms($post->ID,'artist')))); $query = new WP_Query($args);