get_terms (or tax_query) for term of current post?

SOLVED This was what I was looking for and it works like a charm. function my_query_args($query_args, $grid_name) { $term_list = get_the_terms( get_the_ID(), ‘category’ )[0]->slug; if ($grid_name == ‘JTS-SINGLE’) { $query_args[‘tax_query’] = array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => array( $term_list ), ), ); } return $query_args; } add_filter(‘tg_wp_query_args’, ‘my_query_args’, 10, 2);

get_previous_post() while accounting for sticky posts

Ok, this might be overcomplicating things a bit, but at least it should work (untested). Just call the function like so get_adjacent_without_sticky( get_the_ID(), true); // get previous post get_adjacent_without_sticky( get_the_ID(), false); // get next post This could have been solved easily, if get_previous_post() allowed for an ID to pass and not only run it in … Read more

How do I find a way to create a global single.php for a custom post type?

There re various filters you can use to inject your custom template. One being the template_include, the other single_template, and even type_template. The easiest one would be single_template in your case (example from codex): function get_custom_post_type_template($single_template) { global $post; if ($post->post_type == ‘my_post_type’) { $single_template = dirname( __FILE__ ) . ‘/post-type-template.php’; } return $single_template; } … Read more

Defined function isn’t showed on page

There’s no relationship between how the function is written, and how you’re attempting to use it. The first problem is that your function returns a value, rather than echoing it. So if you wanted to output the value you need to use echo: echo social_sharing_buttons(‘post’); But the usage of ‘post’ doesn’t make sense here. Your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)