Support » Fixing WordPress » Philosophy of WordPress API

  • 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 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Philosophy of WordPress API’ is closed to new replies.