I’m having a problem viewing the Youtube video
You should use the_content function to process embeds. Another way is to apply the_content filter. apply_filters( ‘the_content’, $post->post_content’ );
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);
Use the_post_navigation( $args ); to display next and previous links in your template for a single post. To restrict links to the same category, your $args array, in its simplest form, should be: $args = array( ‘in_same_term’ => true, ); Other parameters are optional. Get their list here.
Take a look at the WP’s template hierarchy. When a page is requested WordPress searches for the file to load in a specific order. You can create a template specific to your custom post type. You would copy the file called single.php and name the copy single-{post_type}.php where “post_type” is the name of your CPT. … Read more
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
The syntax is wrong. Write the condition as: if (is_single()) { your code here }
You should use the_content function to process embeds. Another way is to apply the_content filter. apply_filters( ‘the_content’, $post->post_content’ );
This seems like a similar question, but I’ll also put it here. ‘has_archive’ => ‘richards’ Then flush permalinks (Settings > Permalinks).
The context isn’t really right for creating a new post. You’ll be on single-product.php if you’re viewing an existing post, but not for a post that you’ve yet to create! I can think of two approaches. 1 – put an “Add Product” link or button onto your existing form and configure it so that a … Read more
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
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