• Resolved tripwater

    (@tripwater)


    Hello, I have been going all over trying to figure out something that should be simple. I see people editing php code, uploading new files with customer code and using plugins. I found a post Here where the original poster seems to want what I want. I have a website that I want to post images and videos that are goofy for people to sift through much like a Chive or CollegeHumor website. Just for fun and our friends.

    With that said, I am trying to figure out how to put up daily images in a post, put that post in a category and have a menu link that loads a page with most recent categories at the top desc. But I only want a single image for each post to show ( featured image ) and when you click on it, it loads that post.

    For an example of the end result you can go here Chive Notice how the landing page is a list of posts and there are linked by way of the ‘Merica’ category. Clicking on the main featured image will take you to that post.

    I found this Page Links To plugin and was hoping to get what I needed to work. As a test, I added a category called Christmas Time. Menu Christmas Time under Photos. I then created two test posts and linked them to this category and then pointed the Page Links To to my domain/?cat=13 which is the category. Right now it takes you to a page and lists out the featured image then the category with all the images in the post then the next featured image for the next post and all its images.

    If someone could enlighten me as to achieve the end result I am looking for, even if I have to scrap all this and do something else, I am all ears. Ultimately I would like a website much like the chive where we can easily post images and videos and have tags/categories that people can go to in order to see ‘idiots in boats’ or ‘fat people on skates’.

    A clean way to organize and present the stuff.

    Thank you for any help and your time with this.

    Here is the beta start up website https://wetdynamite.com

Viewing 5 replies - 1 through 5 (of 5 total)
  • Why don’t you use your home page for posts instead of a static page…

    Make sure you have some posts with content, featured image, and categories/tags selected. (tags are key words and I think that is what you’re looking at in your Chive sample)

    Let’s see where that puts you and you can narrow down your question from there.

    Lee

    (@romanempiredesign)

    This will do what you want. It will output your posts with their featured images as thumbs to a div format. From there you can style it with CSS.

    This particular code is designed to grab posts from a single parent. You could also use categories.

    $postList = "";
    $args = array(
                    'parent'		 => '1',
                    'sort_column'    => 'ID',
                    'order'          => 'ASC',
                    'posts_per_page' => '-1'
                );
    $homePosts = get_pages( $args );
                foreach ( $homePosts as $block ) {
    
                    $customField = get_post_custom($block->ID);
                    $link =  get_permalink($block->ID);
                    $title = get_post_field('post_title', $block->ID);
                    $thumb = wp_get_attachment_url( get_post_thumbnail_id($block->ID));
    
                    $postList .= sprintf( '<div class="item"><img src="%s" alt="%s" /><p><a href="%s">%s</a></p></div>', $thumb, $title, $link, $title);
    
    }
    echo $postList; ?>
    Thread Starter tripwater

    (@tripwater)

    ( thanks for the replies )

    @janet4now, I am not really versed in WP. I have had a little experience in the past but seem lost as of recent to the current flow. The reason for static was I wanted a landing pad that I would add stuff to like recent posts, a welcome message, misc stuff as I progressed and let the menus take you to the relative sections. I may be confused as to how all this works.

    @lee, at a glance what you describe sounds like what I want but not sure where to put it. I assume I need to either edit an existing file? or upload a new one and put that code in? And if new file, I assume I need to do all the extra code for including sidebars, footer and header so that my site continues looking the same…

    I should have mentioned earlier that I am not a guru but have some limited experience. I am familiar with php code so I am not afraid to get my hands dirty. Most of my experience is procedural code though.

    THanks again for your time. I hope I did not add further confusion to the discussion.

    ??

    Thread Starter tripwater

    (@tripwater)

    OK @janet4now I switched my home page to Latest Posts. THis changed my homepage to now show the both test posts with all the images listed.

    Ultimately I would like to have single category that you would click from home page that takes you to a list of latest posts for that category ( as if you clicked the menu for the cat ) and in both scenarios not list out all the images of the post but instead be a clean, single image with the category title and when you click on the specific category then it takes you to the the post with the images you can scroll through.

    Again @lee, at a glance what you describe sounds like what I want but not sure where to put it. I assume I need to either edit an existing file? or upload a new one and put that code in? And if new file, I assume I need to do all the extra code for including sidebars, footer and header so that my site continues looking the same…but I am not sure where I would put the php code you suggested.

    Right now I am keeping things simple on my site until I understand the flow and layout so there is only the Photo menu with Christmas Time Sub Menu that should take you to a page with 2 posts and not list out all the images in the post but rather just show post title and single image for each post in the category. I removed the featured image for both posts as it was just listing the featured image then the post with all the images including the featured image.

    Also as a reminder I am currently using the Page Links To plugin and both posts are pointing to the permalink https://wetdynamite.com/?cat=13 Not sure if I should be using this plugin or if I should go back to the normal permalink layout I was using for Day and Name.

    Any help in direction and clarity would be very welcome. Thank you again for your time.

    Link to site

    Thread Starter tripwater

    (@tripwater)

    Nevermind. Not getting much feedback here. I found a template that seems to do more for me and starting there.

    Have a good one.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page Links To’ is closed to new replies.