hassanjunaid
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Adding custom taxonomy to search resultsThanks for your response and guidance once again.
The url inspection report shows the page is not indexed. And about the sitemap it says, no referring sitemap detected. Also, no referring page is detected. This is the same for all the pages with Page with redirect error.
Hi Hari,
Thanks for your response, but I cannot revert the url structure for trailing slash to non-trailing slash as, more than 58K posts are indexed on this new url structure. WordPress is automatically redirecting the old urls to the new urls, so Redirection plugin, I think is not a solution. In fact, this is the problem, I want to resolve. Anyway, thanks again.
- This reply was modified 3 months, 3 weeks ago by hassanjunaid.
I have changed the method from GET to POST and everything is working fine. My concern is, why GET method is showing this unusual behavior? I am trying to figure out this problem. One possibility that I think of is that maybe WordPress has removed this GET method in custom forms for security purposes.
Forum: Everything else WordPress
In reply to: Page with redirect error on Google Search ConsoleForum: Everything else WordPress
In reply to: Page with redirect error on Google Search ConsoleGoogle Search Console is taking it as a problem which prevents the stories from getting indexed.
Thanks for your time and concern. The issue has been resolved. Main problem was with Yoast SEO plugin. It automatically overridden the permalink structure, which lead to this issue. Changing Yoast settings resolved the problem. Once again thanks a lot for your precious time.
Thanks for your response. I know that I have my feed for the front page as I have already mentioned. I am concerned about feed from other pages like category pages. It is giving 404 error. For your knowledge, previously there was feed for all the pages on the website. This is a recent issue.
Thank you for your time. The issue which actually never existed has been resolved. I was using the wrong URL. Again thanks a bundle.
Let me share the category.php code with you for better understanding.
<?php get_header(); ?> <section> <div class="container"> <div> <!-- Billboard Ad Start --> <?php get_template_part( 'template-parts/content/billboard-ad' ); ?> <!-- Billboard Ad End --> </div> <div class="row"> <div class="col-md-12"> <!-- Breadcrumb --> <ul class="breadcrumbs bg-light mb-4"> <?php echo website_breadcrumbs(); ?> </ul> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-md-8"> <aside class="wrapper__list__article "> <h4 class="border_section"> <?php single_cat_title(); ?> </h4> <?php $category_id = get_query_var('cat'); $args = array( 'cat' => $category_id, 'paged' => get_query_var( 'paged' ) ); $category_posts = new WP_Query($args); if($category_posts->have_posts()){ while ($category_posts->have_posts()) { $category_posts->the_post(); ?> <div class="card__post card__post-list card__post__transition mt-1"> <div class="row "> <div class="<?php echo (is_category('opinion')?'col-md-3':'col-md-5'); ?> mb-2"> <div class="card__post__transition"> <a href="<?php the_permalink(); ?>"> <?php if(is_category('opinion')){ ?> <img style="width: 150px;height: 150px;" src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'large'); ?>" loading="lazy" class="img-fluid" alt="<?php echo get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );?>"> <?php }else{ ?> <img src="<?php echo get_the_post_thumbnail_url(get_the_ID(),'large'); ?>" loading="lazy" class="img-fluid w-100" alt="<?php echo get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );?>"> <?php } ?> </a> </div> </div> <div class="<?php echo (is_category('opinion')?'col-md-9':'col-md-7'); ?> my-auto pl-0"> <div class="card__post__body "> <div class="card__post__content mb-1 "> <span class="bg-primary p-1 text-white small "> <?php single_cat_title(); ?> </span> <div class="card__post__author-info mt-2 mb-2 "> <ul class="list-inline"> <li class="list-inline-item"> <span> <a class="text-dark" href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>"> <?php the_author(); ?></a> </span> <span> <a class="text-dark" href="<?php echo get_author_posts_url(get_field('co_author')); ?>"> <?php if(get_field('co_author')) echo get_the_author_meta('display_name', get_field('co_author')); else echo ""; ?></a> </span> </li> <li class="list-inline-item"> <span class="text-dark text-capitalize"> <?php echo time_display(); ?> </span> </li> </ul> <?php if (is_category('opinion')) { ?> <div class="text-dark mt-2"> <?php echo get_field('article_author'); ?> </div> <?php } ?> </div> <div class="card__post__title"> <h5> <a style="text-transform: none;" class="truncate" href="<?php the_permalink(); ?>" title="<?php echo get_the_title(); ?>"> <?php the_title(); ?> </a> </h5> <p class="d-none d-lg-block d-xl-block mb-0"> <?php if(has_excerpt()){ the_excerpt(); } else{ echo ""; } ?> </p> </div> </div> </div> </div> </div> </div> <?php } } wp_reset_postdata(); ?> </aside> </div> <!-- Sidebar Start --> <?php (is_category('latest'))? get_template_part( 'template-parts/content/sidebar-latest' ) : get_template_part( 'template-parts/content/sidebar' ) ; ?> <!-- Sidebar End --> </div> <!-- Pagination Start --> <div class="mx-auto"> <div class="pagination-area"> <h6> <?php $args = array ( 'prev_text' => '?', 'next_text' => '?' ); echo paginate_links( $args ); ?> </h6> </div> </div> <!-- Pagination End --> </div> </section> <?php get_footer(); ?>
This code is working perfectly fine for all the categories, also the posts with “videos” category, added previously with editor. The issue is only when I create posts through code.
- This reply was modified 10 months, 2 weeks ago by hassanjunaid.