• rafuka

    (@rafuka)


    Hi.
    I’m creating a theme for a blog, and I’m having this issue:

    In the blog page, I want to display the blog posts with some particular style. But, in the archives, I’d like to display the posts with a different style.

    I thought that maybe I can modify the main loop file that runs in the blog page and then create a different loop that runs on the archive.php file.. Is this possible? Is there a better way to do it?

Viewing 1 replies (of 1 total)
  • msebesta

    (@msebesta)

    Hi Rafuka.

    WordPress is set-up to do exactly that. If you want to edit the design for the single blog page you will want to edit your themes single.php php code and css.

    To modify the display on the archive page you would edit the archive.php file. In both php files you would still need to have the infamous WordPress Loop.

    Here is a pretty handy website to explain how the php files run, and how to override them. https://wphierarchy.com/

    In WordPress, if you had a custom post type called “movies”. If you wanted to have a different display for the single movie or movies archives you can do this by creating two new php files.

    1. single-movie.php to change the code structure for the single movie page.
    2. archive-movie.php to change the code structure for the archive movie page.

    Good luck and I hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Having two different loops on one theme’ is closed to new replies.