WP Framework Forums

A blank WordPress Theme Framework

Register or log in - lost password?

WP Framework Forums » General Discussion

Consistency with Wordpress

(4 posts) (2 voices)
  • Started 5 months ago by jufemaiz
  • Latest reply from jufemaiz
  • 1 Members Subscribed To Topic
  • Related Topics:
    1. Using search bar in a different sub-folder?
    2. style post with specfic body tag
    3. PLEASE HELP! How do I get my posts to display in a different page?
    4. Cross browser compatibility
    5. Semantic Title Separator When There Is No Wordpress Tagline

Tags:

  • class
  • consistency
  • structure
  • wordpress
  1. jufemaiz
    Member

    Just proposing some consistency with wordpress class conventions.

    wp_list_pages provides "page-item-#{$page->ID}" for the class convention when referring to pages, while wpframework is using "pageid-#{$page->ID}".

    The fix is the following (with backwards compatibility):
    File: ./library/extensions/semantic-class.php

    Line 169
    $classes[] = 'page pageid-' . $pageID;
    to
    $classes[] = 'page pageid-' . $pageID.' page-item-' . $pageID;

    Line 173
    if ( $wp_query->post->post_parent ) $classes[] = 'page-child parent-pageid-' . $wp_query->post->post_parent;
    to
    if ( $wp_query->post->post_parent ) $classes[] = 'page-child parent-pageid-' . $wp_query->post->post_parent . ' parent-page-item-' . $wp_query->post->post_parent;

    Line 184
    $sc[] = 'page pageid-' . $pageID;
    to
    $sc[] = 'page pageid-' . $pageID . 'page page-item-' . $pageID;

    Line 190
    $sc[] = 'page-child parent-pageid-' . $wp_query->post->post_parent;
    to
    $sc[] = 'page-child parent-pageid-' . $wp_query->post->post_parent . 'page-child parent-page-item-' . $wp_query->post->post_parent;

    Thoughts?

    Posted 5 months ago #
  2. Ptah Dunbar
    Framework Overlord

    Just added those changes to the latest trunk (with your credit). Thanks for pointing that out.

    Edit: Wait a minute. Looking at your proposal, it's just adding the same thing just worded differently. I'd prefer only using one way.

    Posted 5 months ago #
  3. Ptah Dunbar
    Framework Overlord

    Looking at the get_body_class() function, it uses postid, so I'm probably just going to revert back to that one since it models what semantic_body() is doing closer.

    Posted 5 months ago #
  4. jufemaiz
    Member

    Hrmm ok - so there's inconsistency with the wordpress methodology.

    Can we shift it to "page-id-#{$page->ID}" instead? Closer doesn't work when one character difference means completely different outcome…

    Posted 5 months ago #

RSS feed for this topic

Reply

You must log in to post.

WP Framework Forums is proudly powered by bbPress.