• Resolved jonradar

    (@jonradar)


    any help would be greatly appreciated. i’m new to wordpress. i’ve been searching this support forum for a few hours and can’t find any help on this (seemingly simple) issue.

    basicaly, i want to set my new wordpress blog to list my 20 most recent posts, by title, in the sidebar on the right. how do i set this up? thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • This should help ya, just copy and paste that into your sidebar.php file, and up the number 10 to 20. I hope this helps. =)

    Make the 10 in that line, into a 20. ??
    $posts = get_posts('numberposts=10&offset=0');

    https://www.vindictivebastard.net/downloads/last-10-posts.txt

    spencerp

    Thread Starter jonradar

    (@jonradar)

    sounds good – except i can’t find the sidebar.php file. (like i said, i’m an utter newbie.) many thanks.

    Thread Starter jonradar

    (@jonradar)

    sorry. okay, found it (on my FTP page.)

    new question – where do i post it amid all the code? at the front? the end? again, thanks for any info.

    EDITED* Oh! Oh you!.. LOL! Um, some where you think it should be at maybe? I don’t know what theme you’re using, have a blog URL for “us”?

    Umm, it should be in the wp-content/themes/your-theme directory? If your theme file’s are chmodded atleast 666, so you can edit them via the Blog’s Control panel:
    https://www.vindictivebastard.net/images2/theme-files-chmod-666-to-edit.gif

    Presentations => Themes => Theme Editor

    Then, click on the link in the sidebar there, that says Sidebar.php. That will pull it into the editing window. Then edit from there.. I hope this helps.

    spencerp

    Thread Starter jonradar

    (@jonradar)

    okay, i found the sidebar.php file, and pasted the line of code. it didn’t seem to change the sidebar.

    my site’s url is https://www.mylifeonmars.com. (not much content, just getting it going, naturally.) thanks.

    Did you copy all of this code from here right? You need to make sure you select ALL of the code, from this file here, then paste it into sidebar.php file:
    https://www.vindictivebastard.net/downloads/last-10-posts.txt

    And then just change the number 10 to a 20?

    spencerp

    Thread Starter jonradar

    (@jonradar)

    sweet – that seemed to work. now the followup question: how do i move this “post list” to the top of my sidebar, and give them a title, something like “2o Recent Posts”? thanks.

    Um, like I said above there.. find this line in that code, that you pasted into the sidebar.php

    Find this:
    $posts = get_posts('numberposts=10&offset=0');

    Replace with this:
    $posts = get_posts('numberposts=20&offset=0');

    To move it up top, cut all that code you just pasted in there, and move it up top within the codes, in your sidebar.php file..

    spencerp

    Thread Starter jonradar

    (@jonradar)

    awesome. thanks for the info, and for your patience. last thing, i swear: i’ve moved the 20 posts list up to the top of the sidebar, but how do i put a title above the posts? like right now, the sidebar has a “Pages” and an “Archive” title above the, uh, pages and archives. how can i add one more called “Recent Posts” or whatever? thanks, i really appreciate it.

    Find this code here, near the top of that whole code you pasted:
    <?php _e('Activity'); ?>

    Change it to this:
    <?php _e('Recent Posts'); ?>

    Also, you’ll have to adjust the way it looks, with your default theme’s css styles.. I’m very busy now, so maybe someone else can help you with that ok?

    spencerp

    Thread Starter jonradar

    (@jonradar)

    sounds good. i’ll try that, and keep working on it.

    again, many thanks. i really appreciate it. cheers, jon radar

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘newbie needs help – can’t add post titles to main page’ is closed to new replies.