New Posts and Pages Won’t Save

More often than not this is caused by a plugin update or incompatibility. I would suggest disabling all your plugins and trying again. Then re-enable a few at a time until you find the culprit.

the_excerpt is displaying excerpts of every post

Looking at your site, the problem seems to be a little different. For every post, the excerpt of the first post is shown. And not just once, but three times. This happens only on the website, but not the RSS feed or the REST API. Since the code you provided looks fine, it seems that … Read more

How can I insert a new markup element after 4 posts automatically? [closed]

This can be achieved by accessing WP_Query class properties, available while in the loop, like $current_post (index of the current post), $post_count (number of posts displayed), $found_posts (total number of posts matching query). By using $current_post, $post_count and PHP modulo, like shown below: <?php if ( $custom_query->have_posts() ) : while ( $custom_query->have_posts() ) : $custom_query->the_post(); … Read more

singular posts using archive styling

if you are not aware of WordPress template structure. https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/ https://developer.wordpress.org/themes/basics/template-hierarchy/ WordPress follow a hierarchy for post/page templates archive.php for your archive pages of post and category. single.php for your every WordPress single post. you can adjust your single.php code to make single page HTML different then archive page. In your case to separate styling … Read more

Only allow posts with a specific term to only be viewed by other authors with the same term in their post

You’d do something like $current_user = wp_get_current_user(); to get the current user, then you’d want their posts $current_user_posts = get_posts(array( ‘author’ => $current_user->ID, ‘posts_per_page’ => -1 ); with their posts, you’d cycle through them, and grab the terms $current_user_terms = array(); foreach ($current_user_posts as $user_post) { $user_terms = wp_get_post_terms($user_post->ID, ‘custom_tax’, array(“fields” => “ids”)); foreach ($user_terms … Read more

How to add html code at the bottom of the post in archive page?

Open archive.php from your theme’s directory the code will look like this <?php /* Template Name: Archives */ get_header(); ?> <div id=”container”> <div id=”content” role=”main”> <?php the_post(); ?> <h1 class=”entry-title”><?php the_title(); ?></h1> <?php get_search_form(); ?> <h2>Archives by Month:</h2> <ul> <?php wp_get_archives(‘type=monthly’); ?> </ul> <h2>Archives by Subject:</h2> <ul> <?php wp_list_categories(); ?> </ul> </div><!– #content –> </div><!– … Read more