WordPress.org

Support

Support » How-To and Troubleshooting » Add image section to my website.

Add image section to my website.

  • Here I go again with wuestions lol.

    So this was one of thsoe things that I thought would be pretty damn easy to do. but apparently not.

    http://www.LetsKillSomeTime.com

    On the top of the main page, under the header I want to add text/box that says “Image Section” , That I know how to do, Just add a menu.

    But when Someone click on that, I want them to be taken to a page which looks like that main page with the same ammounts of posts per page etc but this time its only images. So The main pages has 8 new videos per day. And when you click on “images section” you go to a page with 8 new images per day.

    How do I do this? I have tried, and looked around but no luck. I thought it was going to be super easy. But no, and I have no idea why.

    Take care

Viewing 15 replies - 1 through 15 (of 24 total)
  • still havent figured it out lol.

    esmi

    @esmi

    Forum Moderator

    Thank you. Will read

    So, I first create a .php file (through wordpad?) named “Snarfer” (for now) and inside that file I add the code.

    Then I create another .php named “pageofposts.php” with that code inside it and save it.

    Then I add both of those files inside my current theme folder through a ftp program? Thats the first step? =)

    Or do I just add the pageofposts code below the sparfer coding? in that snarfer .php

    and then upload the snarfer.php through my proxy with both of the codes into my current theme folder

    and then create a page in wordpress, not adding any text but just a title and then int he “selct template” I select “Snarfer” and press publish, and then I add posts to That template?

    esmi

    @esmi

    Forum Moderator

    I first create a .php file (through wordpad?

    No! Only use a plain text editor such as NotePad.

    Then I add both of those files inside my current theme folder through a ftp program? Thats the first step?

    Correct.

    then create a page in wordpress, not adding any text but just a title and then int he “selct template” I select “Snarfer” and press publish

    Correct.

    then create a page in wordpress, not adding any text but just a title and then int he “selct template” I select “Snarfer” and press publish

    No. Select Page of Posts as the template. The code will then do all of the work. You don’t add anything else.

    Ok, lets do it again it since I added both of the codes in one .php and using wordpad.

    I’II be back lol.

    I have done as you said now. And added the page into the “main menu” or whatever its called so I have it under the mean header. But clicking on it it has added a bunch of stuff automatically. How to I remove that and start adding posts with images in them?

    http://www.LetsKillSomeTime.com “photos” under the mean header

    that dude seems to be adding posts into a category and then having them show up where he wants it..

    esmi

    @esmi

    Forum Moderator

    clicking on it it has added a bunch of stuff automatically.

    Yes – that’s being created by the code that you added as part of the page of posts.

    How to I remove that and start adding posts with images in them?

    You cannot “add” posts to this kind of Page ad hoc. The Page displays posts based on specific criteria as pre-defined in the code.

    that dude seems to be adding posts into a category and then having them show up where he wants it..

    Correct.

    Well my whole point of this was to being able to add images to a “photos” section of the site..
    Since I mentioned that in the first posts I thought that was what you were helping me with..

    I guess I want to do what hes doing I think?

    esmi

    @esmi

    Forum Moderator

    Create a category called Photos. File posts under the Photos category as required. Amend the PageofPosts template to pull from the Photos category. Job done.

    “Amend the PageofPosts template to pull from the Photos category”

    would you mind helping me with that?

    “Create a category called Photos. File posts under the Photos category as required. “

    photo automatically gets posted on front page atm at least, which is the main issue all along

    esmi

    @esmi

    Forum Moderator

    http://pastebin.com/ywK4E79E
    An amended version of the code from http://codex.wordpress.org/Pages#A_Page_of_Posts that simply displays all posts from the Photos category – including sticky posts.

    http://www.letskillsometime.com

    as you can see that seems to be the case now, Now its just the problem of removing the photo from the main page, and still having it show up when you Click “photos”

    // If I ever in the incredible distant future make some money from this site, I will give you some asmi lol.

    esmi

    @esmi

    Forum Moderator

    You now need to add a custom query to the theme’s index.php template file to exclude the Photos category. First you need to How do I find an id?“>find the id of the Photo category (let’s assume it’s 23), then create your new custom query:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => '-23', // the id of the Photos category
    	'paged' => $paged
    );
    query_posts($args);
    ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    [etc]
Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Add image section to my website.’ is closed to new replies.