Support » Fixing WordPress » Display posts as grid for specific category

  • Hello –
    I have a specific category where I’d like all of the posts displayed in a grid fashion (columns/rows). I tried the ‘posts per cat’ plugin, but that didn’t seem to work. Any suggestions?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    Thanks for the quick response alchymyth. I created a category-[id].php as well as category-[slug].php file and added ‘echo’ statements in both just to see if that category was reading from that php file, but unfortunately it isn’t 🙁 I copied the contents from category.php to those new files as well. Any suggestions?

    Michael

    (@alchymyth)

    Forum Moderator

    is the specific category archive still using the default category.php?

    temporarily deactivate all plugins to see if one is interfering;

    if so, then reactivate one at a time to find which one.

    I know the category.php file that it’s reading is under the wp-includes directory, because when I put an ‘echo’ statement in that file it displayed it on the screen. Is this the default category.php? This is the same directory where I placed the category-7.php and category-adopted.php files that had echo statements as well, but those didn’t get displayed on the screen. I did deactivate each plugin one by one, but still didn’t’ see the echo from either of those files.

    Michael

    (@alchymyth)

    Forum Moderator

    the category.php file that it’s reading is under the wp-includes directory

    we are talking only about files within your theme’s folder.

    does your theme have a category.php?

    you can check under dashboard – appearance – editor: make sure your theme is selected at the top, then check the file list on the right.

    /wp-includes/ files are WordPress core files and should not be edited.

    I don’t see category.php in my theme when viewing via the WP editor 🙁 could it be named something else?

    Michael

    (@alchymyth)

    Forum Moderator

    http://codex.wordpress.org/Template_Hierarchy

    your theme might have an archive.php;

    do create your category-{id}.php in your theme’s folder, and see if that works.

    you could start with a copy of archive.php or index.php, and edit from there…

    Thank you alchymyth! I copied the contents from archive.php, created a file named category-7.php and that seemed to do the trick.

    Any suggestions for displaying all of the posts in a grid?

    Michael

    (@alchymyth)

    Forum Moderator

    Any suggestions for displaying all of the posts in a grid?

    depends on teh existing structure of your theme; also on how many per row, if flexible heights per post …

    I have some general concepts on my site:
    3 posts per row;
    stacked grid;

    and you should be able to find some more when unsing the forum serach…

    I ended up finding a plugin to do exactly what I need. It’s called “Category Grid View Gallery.” Thanks for the help, as I do have a better understanding now of how to have wordpress apply settings differently between categories (by having additional php pages with the id number/slug appended to it).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Display posts as grid for specific category’ is closed to new replies.