Co-Authors Plus: How do I get all authors with a query?

If you are using Co-Authors Plus plugin. By default, it will show the original author of the post. You’ll need to edit theme files with the code responsible for showing the author name for posts. This could be single.php, content.php, or a template tag in your theme’s functions.php file. the_author_posts_link() and you will need to … Read more

Shortcode to pull posts

UPDATE Turns out the issue was with the first page of posts. I needed to account for page 1 when calling the ajax load more. Since this is a shortcode and not a template my query vars were not passing along to the ajax call. I resolved the issue by passing the page as a … Read more

WordPress PHP command and ELSE IF problem

It could work like this; but you need to use get_field() instead of the_field(), since the latter displays the field instead of returning a value. See https://www.advancedcustomfields.com/resources/the_field/ for more information.

Getting different user data depending on where I use variable

I’ve only seen some parts of your code, but I guess I know where the problem lies… If this is what you’re printing in the loop: <script type=”text/javascript”> jQuery(document).ready(function($) { $(‘.callback’).val(‘<?php echo $user->first_name; ?> <?php echo $user->last_name; ?>’); }); </script> <?php echo do_shortcode( ‘[contact-form-7 id=”12345″]’ ); ?> And you want to output multiple forms on … Read more

Cant display an image via PHP in wordpress

I think that you need echo the image, try this: <php $image = wp_get_attachment_image_src( $post_thumbnail_id ); //echo( $image[0] ); ?> <img src=”https://wordpress.stackexchange.com/questions/319794/<?php echo $image[0]; ?>” alt=””>

exchange words in echo

The PHP echo language construct that outputs the parameters passed. You don’t want to do that in the middle of str_replace. To replace $term->name with an empty string, use: $wptitle = str_replace( $term->name, ”, $wptitle ); Then when you want to print it, use: echo $wptitle;

How to separate categories with commas?

All you have to do is to track if you already echoed some category and add a comma in such case: function get_level($category, $level = 0) { if ($category->parent == 0) { return $level; } $category = get_term( $category->parent ); return get_level( $category, $level + 1 ); } function display_cat_level( $level = 0, $link = … Read more