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’ );
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
The problem is that your date format is not a standard format that strtotime() understands. Instead just use get_the_date() with the format set to ‘U’, which returns the timestamp, and compare that to strtotime( ‘-1 year’ ): if ( get_the_date( ‘U’ ) < strtotime( ‘-1 year’ ) ) { }
So i resolved that noob question… here is a recipe step by step; get some sleep repeat what you leaned with a fresh mind apply the structure: <?php if( get_field(‘field_name’) ): ?> <p>My field value: <?php the_field(‘field_name’); ?></p> <?php endif; ?>
Your best bet is to use the WordPress rewrite API. No .htaccess required. First, hook into init and add a rewrite endpoint to your permalinks. This tells WordPress that whens some visits /category/post-slug/gallery match the new endpoint rewrite. it also takes care of adding the query variable for you so you don’t have to do … Read more