WordPress.org

Ready to get started?Download WordPress

Forums

Philosophy of WordPress API (3 posts)

  1. Maciej Ku? (maciekkus)
    Member
    Posted 9 years ago #

    Hello,
    I am playing since few days with wordpress. I am trying to use it
    as a simple CMS rather then "traditional-blogging-system".
    My test website is here. (it's in polish)
    I created few categories with names corresponding to navbar links.
    Only on the first page I had to hide posts from other than default category - I used ShowHideCategory Plugin.
    All next subpages are category archives displaying the same way as main page. Last subpage is meant to be contact form - still in mess :) - but what important it's based on wordpress' page item.
    So far it's OK - but when I started to modify my theme I just wanted to use wordpress as a framework which provides me with post and pages sorted to categories, what is ideal for creating small information websites. But I had to stick to defined settings, like tags css class names, '(more)' link which is not differenting in any way from other links in post, and other things.
    And this "Loop" -> it is initiated in some wp-header-*** files.
    I couldn't get list of pages before displaying all posts from default Loop. No problem displaying it after. But my menu is above posts, not below them.
    I don't understand why in WP I couldn't find clear API which I could use to get information such as (for example):
    * get_all_categories -> result with array of categories
    * get_subcategories($category_id) -> result with array of categories
    * get_all_posts($only_excerpts=false) -> array of posts
    All functions (or most of them) contain html tags, css classes names etc.
    I think that easier would be to create raw-php-fetching-posts-function and then encapsulate it with presentation layer code.
    That way you have got template tags (as they are right now) and API for raw data fetching.
    Hope you understand what I mean. If not don't bother :)
    Just few thought after short sleep :)
    Maciek

  2. Joshua Sigar
    Member
    Posted 9 years ago #

    functions with raw output/return values are in the making, no worries

  3. Maciej Ku? (maciekkus)
    Member
    Posted 9 years ago #

    that's great news :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.