Ignoring slug capitalization on rewrite rule for custom post type archive page
Ignoring slug capitalization on rewrite rule for custom post type archive page
Ignoring slug capitalization on rewrite rule for custom post type archive page
If you register new custom post types and get weird 404s, you just need to change your permalink settings. This happens to me pretty much every time. You can change the, right back to where they were before. It’s just the act of changing them that does the trick.
You can try to replace this kind of comparison: AND m1.meta_value >= ‘$start_date’ with: AND CAST(m1.meta_value AS DATE) >= ‘” . date( “Y-m-d H:i:s”, $start_date ) . “‘ or if you would use Unix timestamp for the meta values then you could try: AND m1.meta_value+0 >= “. strtotime( $start_date ) .” Update: Here is a … Read more
How to get a custom field value of a custom post?
That doesn’t appear to be a WordPress post Loop so you will need to pass the post ID or the post object to get_post_type. I don’t know much about Relevansi but in your code above, that looks like $hit might be that object. However, I don’t think that is what you want. I may be … Read more
On single post, try something like this: $author_id = get_the_author_meta(‘ID’); $people = get_posts( array( ‘connected_type’ => ‘people_to_user’, // replace with whatever ‘connected_items’ => $author_id, ‘suppress_filters’ => false, ‘nopaging’ => true ) ); Now $people[0] references the first (and only) author related to the post you’re on. So $people[0]->ID can be used to get the various … Read more
Jquery solution: **assuming your posts are in a division with the class of “post”. <script type=”text/javascript”> $(document).ready(function(){ $(“.post p”).each(function(){ $(this).addClass(‘paragraph’); }); $(“.post ul”).each(function(){ $(this).addClass(‘list’); }); //add more lines here to select more elements }); </script> Paste this in your footer. *you need jquery installed. And better yet would be to enque this using http://codex.wordpress.org/Function_Reference/wp_enqueue_script
set permalink for CPT
A CPT has a parameter called show_in_menu to add it to a specific menu. You must set you CPT to ‘public’ => true Then in your deals $args (it’s unclear which one you wanted added ) add something like, ‘show_in_menu’ => ‘edit.php?post_type=screenshots’ You can then adjust it accordingly.
Hierarchical custom fields