WordPress.org

Ready to get started?Download WordPress

Forums

Display number of entries? (14 posts)

  1. Sparky
    Member
    Posted 8 years ago #

    Is there a snippet that displays the amouny of posts, pages, categories, etc. (what I define) when you place it on the page? For example: "There are currently # of posts, # pages, and # categories."

  2. Nicki Faulk
    Member
    Posted 8 years ago #

    Perhaps something like this plugin?

    http://wordpress.org/support/topic/29404?replies=25

  3. Sparky
    Member
    Posted 8 years ago #

    i'll try that. thanks.

    edit

    it didn't work...

  4. Nicki Faulk
    Member
    Posted 8 years ago #

    I'm sorry to hear that. :(

    Perhaps you could contact the author to see if a new version is in the works?

    I've looked at several WordPress plugin repositories and haven't seen a stats-type plug yet that does what you're wanting, but I'm sure it's out there.

    If you don't mind having separate plugins to do the work, there are some at http://wp-plugins.net/ in the Search & Stats category that could possibly do what you need in combination with each other. (i.e. CatCount, MsgCount, etc.)

  5. Sparky
    Member
    Posted 8 years ago #

    i only really need the amount of categories and the amount of posts. i have a small tutorials site (nothing too advanced though) and it's run on wordpress, so rather than index.php having the most recent entries, i wanted it to be a welcome message, stats about the tutorials, updates, etc.

    i posted on the board for that plugin and i'll try to figure something out. thanks.

  6. Nicki Faulk
    Member
    Posted 8 years ago #

    Sounds completely doable. You'd need a plugin for the static front page, there are several out there but here's one that I have used extensively:

    http://www.semiologic.com/software/static-front/

    Also, there's a tutorial in the WP Wiki on how to do it yourself:

    http://codex.wordpress.org/Creating_a_Static_Front_Page

    What you could do is create a "home" Page in WordPress and include the items/information that you want to be displayed on your front page.

    I've done this with both my personal site and hobby site, as well as several customers.

  7. Sparky
    Member
    Posted 8 years ago #

    i thought i could just delete the info on index.php with the post info. should i try the plugin instead?

  8. Nicki Faulk
    Member
    Posted 8 years ago #

    I highly suggest it. :)

    It would also make things easier to edit because you can do it from within WordPress and use the Preview pane to see how everything's laid out before making it "live" :D

  9. Sparky
    Member
    Posted 8 years ago #

    Yeah, true...

    I'm having one problem though. The title of the page displays in <h2>, but I don't want <h2> to say "Home", I want it to say "Welcome to ATB Tutorials". When I change the page name to "Welcome to ATB Tutorials", then in the navigation it has the link saying that, rather than home. Should I just exclude that link and add a seperate one?

    Also, now another plugin doesn't work because I have to put the PHP inside the post...

  10. Nicki Faulk
    Member
    Posted 8 years ago #

    Depending on your template, you may need to adjust some space, I don't know, but this is what I did to fix that on mine: I deleted the title of the page from within the WordPress Manage Page section, and in the body of the page I added an H2 line with what I wanted to display.

    re: plugin not working. Which plugin? And are you getting an error message? If so, what does it say? What PHP code are you putting in to get this error message? (Or did it start when you activated Run PHP?)

  11. Sparky
    Member
    Posted 8 years ago #

    When I had Run PHP installed, the PHP wouldn't run inside my posts. When it was uninstalled it didn't work either.

    Rather than using the static page plugin (I don't like having it an actual page...) would it work if I just deleted the post info. stuff off the index.php? That way the PHP would work bc it's not in a post, my <h1> and sidebar won't be affected, and the most recent posts don't show up...

  12. Nicki Faulk
    Member
    Posted 8 years ago #

    I think it could but only if all other php files exist for your template hierarchy.

    See this page for explanations and listings:
    http://codex.wordpress.org/Theme_Development#Theme_Template_Files

    Basically, any template file not found would use the next in line in the hierarchy. If none are found, index.php is used, and could be a problem if you clean it out.

  13. Nicki Faulk
    Member
    Posted 8 years ago #

    You said: "When I had Run PHP installed, the PHP wouldn't run inside my posts. When it was uninstalled it didn't work either."

    What code exactly did you post in the page? What was the result after publishing the page? (And the error message if one was showing either on the page or in error.log.)

  14. Sparky
    Member
    Posted 8 years ago #

    i have the post and category count plugins from http://linux.linux.dk/projects/ . even when run php was installed, nothing would show up where i put the php for those plugins. for example, right now on index.php i have:

    <h2>Welcome to ATB Tutorials!</h2>
    welcome message here

    There are currently <?php MsgCount(); ?> tutorials classified in <?php CatCount(); ?> categories.

    when i had the static front page and run php plugins activated, where the # of cats. and # of posts was supposed to show up, it was blank (when the home page was a wp page)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.