WordPress.org

Support

Support » Multisite » Permalink displays incorrect URL and not support switch_to_blog function

Permalink displays incorrect URL and not support switch_to_blog function

  • when we use this code in mobile theme(WordPress Mobile Pack)

    <?php
    switch_to_blog(32);
    global $switched;
    global $post;
    $categories = get_the_category();
    echo 'cat--'.$cat= get_query_var('cat');
    $args = array( 'numberposts' =>5, 'offset'=>1, 'category' =>$cat );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); 
    
    echo  $sql = "select post_title,guid from $wpdb->posts where ID ='".$post->ID."' AND post_type='post' AND post_status='publish' ORDER BY <code>ID</code> DESC";
     $result = mysql_query($sql);
     $val=mysql_fetch_array($result);
    
    echo $val['guid'];
    echo $val['post_title'];
     ?>
    
    <li><a>" rel="bookmark"><?php get_the_title(); ?></a></li>
    <?php
    endforeach;
    restore_current_blog();
    wp_reset_query();
    wp_reset_postdata();
    
    ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Permalink displays incorrect URL and not support switch_to_blog function’ is closed to new replies.
Skip to toolbar