WordPress.org

Ready to get started?Download WordPress

Forums

Permalink displays incorrect URL and not support switch_to_blog function (2 posts)

  1. Parag Patel
    Member
    Posted 2 years ago #

    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();
    
    ?>
  2. How does the URL display?

Topic Closed

This topic has been closed to new replies.

About this Topic