New answers tagged

0

What I did wrong is, I forget to get author box, hence the_author function was not working, so I add this code in functions.php file add_post_type_support( 'my_post_type', array( 'author', 'excerpt', ) ); then I got author box and in author box, set author name and add this code in custom post file the_author(); or echo ...


1

Try this: function htdat_shortcode_atts_products( $out, $pairs, $atts, $shortcode ) { if ( isset ( $atts['author'] ) ) $out['author'] = $atts['author']; return $out; } add_filter('shortcode_atts_products', 'htdat_shortcode_atts_products', 10, 4); function htdat_woocommerce_shortcode_products_query( $query_args, $attributes ) { if ( isset( ...


0

Anyone coming to this years after the fact and would like the code in full, rather than having to piece this together from comments and the accepted answer, here you go! Declare the function that limits the post results to 1 per author. For me, this was in functions.php: function one_per_author($groupby) { global $wpdb; $groupby = "{$wpdb->...


0

but what I see are answers to how to make a snippet for a redirect but not to avoid it. That's because you can't. If we could turn wp_safe_redirect or wp_redirect into a non-operation and disable it, the next statement is always exit; which ends the request. The result here would be that your author archives have no HTML and the browser displays a blank ...


0

I'm facing the same problem with a Multisite running Wordfence and JWT. I'm not sure if the solution here works for your case... The following doesn't work, it gives a 404 response. If we remove data.author it works without problem. jQuery.ajax({ url: 'https://example.com/wp-json/wp/v2/posts', method: 'POST', crossDomain: true, dataType: '...


Top 50 recent answers are included