• Resolved marudkaaa

    (@marudkaaa)


    I have problem with permalink:

    <?php
       switch_to_blog(1);
       $loop = new WP_Query( array( 'post_type' => 'pressroom', 'posts_per_page' => '10', 'orderby' => 'post_date', 'order'=> 'DESC' ) );
    
       while ( $loop->have_posts() ) : $loop->the_post();
    ?>
    <div>
       <article>
          <header>
             <?php if (has_post_thumbnail()) { ?>
                <a href="<?php echo get_permalink();?>"><?php the_post_thumbnail('thumbnail'); ?></a>
             <?php } else { ?>
                <a href="<?php echo get_permalink();?>"><img src="<?php echo get_template_directory_uri(); ?>/images/img-logo.png"/></a>
             <?php } ?>
    
             <h2><?php the_title(); ?></h2>
             <span><i class="fa fa-calendar-o"></i><?php echo get_the_date(); ?></span>
          </header>
          <?php the_excerpt(); ?>
       </article>
    </div>
    
    <?php
       endwhile;
       restore_current_blog();
    ?>

    I have custom post on blog with id = 1;
    link with custom post with correct permalinks
    But on second blog, where I get the same posts from blog(id=1) I have wrong link (404):
    link with custom post with wrong permalinks (404)
    Someone Could tell me what am I doing wrong?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Multisite & Polylang – wrong permalink’ is closed to new replies.