• wp-photo

    (@wp-photo)


    Hello WordPress Community!

    This is my first post as it is the first time I could not find a solution on here. My question has already been raised by ChristopherMeeks, Errrwin (x2) & spiritbased, marc0047 but there has been no solution.

    I have been trying to get my index.php to redirect directly to the permalink single page of the latest post. This avoids pagination.

    Is there a way to use the loop to query the last permalink and then redirect automatically to it within index.php?

    I would really appreciate any help on this!

    Thank you in advance,

    Carolina

Viewing 1 replies (of 1 total)
  • Thread Starter wp-photo

    (@wp-photo)

    Ok, I have found a solution thanks to marc0047.

    By replacing index.php with only:

    <?php
    query_posts($query_string.'&posts_per_page=1');
    the_post();
    wp_redirect(get_permalink(), '302');
    return;
    ?>

    I was able to achieve what I wanted to do.

    Carolina

Viewing 1 replies (of 1 total)

The topic ‘Automatically redirect from index.php to single.php’ is closed to new replies.