WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need help adding a posts gallery (8 posts)

  1. BunnyBomb
    Member
    Posted 2 years ago #

    Hello there,

    I've recently just started with WP and I'm doing ok with it, but I am now having trouble working out how to create a posts gallery.

    I am creating a website for a pet rescue center. So far I have each pet listing using a nice custom post template called "pets.php", and it seems to be working well. So I decided to get fancy...

    What I would now like to do is create a fixed Page that displays a gallery of all the pet posts, that looks like this one: http://www.scottishspca.org/rehoming/category/cats

    I would like the gallery to display the thumbnail image for the post, and the post title underneath. If there are more than 15 listings, I'd also like to be able to turn the page. I don't need all the fancy menu stuff on the left of the example I gave, just the gallery will do fine.

    It sounds simple in my head, but I've gone sniffing around for plugins and can't find anything that does this. It's possible I'm searching for the wrong words, I don't know what the experts call these things...

    I'd appreciate a helping hand :)

  2. BunnyBomb
    Member
    Posted 2 years ago #

    Oh I should have also mentioned....

    As per the example I gave: clicking on each picture needs to take people over to the full post page. The gallery is also dynamic, depending on posts currently associated with the taxonomy slug "adopt" or taxonomy ID 122 in my case.

    For this reason I cannot use the basic [gallery] function in WordPress.

    It's all about the post content, not about generating a pretty page of pictures. This is why I'm struggling. I expect what I need to do is crate a custom template for the page I am making, then go learn coding for 3 years...

    Since that's not realistic, I wondered if anyone knows of plugins that already achieve what I'm trying to do?

  3. BunnyBomb
    Member
    Posted 2 years ago #

    Update:

    I continued to search today and found a plugin that does almost what I want. It's called Category Grid View Gallery, and is found here http://wordpress.org/extend/plugins/category-grid-view-gallery/

    The one problem is : I need it to pull posts from a specific taxonomy, not a category.

    Is this a simple fix I can make somehow?

    Much appreciated.

  4. BunnyBomb
    Member
    Posted 2 years ago #

    Update:

    I believe I have found the location within the php files that I need to consider changing, but I need some help with the changes please.

    The functions below obtains post data from a particular "category". It seems to only obtain data for posts with the page_type "post".

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I need help to change this so that it retrieves post data for posts that use the custom page type "pet".

    I would also like to add a parameter to be able to define "taxonomy", in the same way the above example is using "tag". This will allow me to generate pages for the different taxonomies that I will use (i.e. cats, dogs, rabbits etc).

    I'd very much appreciate some help with this!

  5. BunnyBomb
    Member
    Posted 2 years ago #

    If it helps, here is the entire page that the above code extract comes from: http://plugins.svn.wordpress.org/category-grid-view-gallery/trunk/includes/CatGridData.php

  6. BunnyBomb
    Member
    Posted 2 years ago #

    Final Update:

    I decided to scrap the plugin. It was fancy and all, but I could see myself waiting days for help to tweak it, the author hasn't posted replies in a while, and if it goes tits up in future I'd be right back here.

    So...I decided to make my own pet post gallery.

    First, I made a custom sidebar template page with this code:
    [Code moderated as per the Forum Rules. Please use the pastebin]

    And voila!

    I'm sure it's not brilliant, but it works a dream and looks really lovely on my site. Just like a bought one, as they say!

    Thanks to everyone for helping....oh wait...duh, I helped myself. I'll thank Google and Girl power then. First bit of coding I've ever done in my life.

  7. BunnyBomb
    Member
    Posted 2 years ago #

    Thank you for the paste bin link.

    So as I said...

    First I created the custom template page (with sidebar included):
    http://pastebin.com/qHJYDPPq

    Then I added some CSS to my stylesheet to turn the output into a grid like table display:
    http://pastebin.com/jkFxSY6F

    I hope it's useful for someone else in future :)

  8. BunnyBomb
    Member
    Posted 2 years ago #

    Oh by the way, the above should work for anyone using the ADA plugin found here : http://wordpress.org/extend/plugins/ada-plugin/

    The template page is designed to show all "pet" posts that currently have the taxonomy status of "adopt". Ergo, you get a gallery of pets up for adoption, as long as all the pet posts have featured images.

    Just remember to set your Settings > Media > Thumbnail to size you want your Thumbnails. I'm using 120 by 120 for my example above.

    You'll have to mess with the CSS to work with your own theme, but it's more or less there. I made this with plain old Twenty Eleven 1.3

Topic Closed

This topic has been closed to new replies.

About this Topic