WordPress.org

Ready to get started?Download WordPress

Forums

Display posts as grid for specific category (11 posts)

  1. boybawang
    Member
    Posted 2 years ago #

    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?

  2. boybawang
    Member
    Posted 2 years ago #

    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?

  3. 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.

  4. boybawang
    Member
    Posted 2 years ago #

    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.

  5. 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.

  6. boybawang
    Member
    Posted 2 years ago #

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

  7. 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...

  8. boybawang
    Member
    Posted 2 years ago #

    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?

  9. 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...

  10. boybawang
    Member
    Posted 2 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.