Forum Replies Created

Viewing 15 replies - 16 through 30 (of 48 total)
  • turk: Yeah I realized as soon as I posted the link to my plugin. I’ll have to adds support for title output another day. In the mean time, use the snippet of code I posted above.

    if (($page = $wp_query->get("page")) || ($page = $wp_query->get("paged")))
    {
    echo $page; // $page is your page number.
    }

    BTW my breadcrumb plugin displays page numbers:
    https://www.thedevproject.com/projects/wordpress-breadcrumb-plugin/

    Try:

    <a href="https://www.example.com" name="example"><h3>Example</h3></a>
    Description text

    If that doesn’t work, try disabling the rich text editor in your user profile.

    Thread Starter wyrd33

    (@wyrd33)

    moshu:

    Perhaps you could give an example of “edit the existing loop”. Or maybe point me to a link in the codex that explains it. Looking through the source code, there’s no reasonable way to do that. By the time WordPress gets to your category-6.php template, the posts have already been queried. Altering anything, including the order, would require another post retrieval from the database, thus another query.

    From the source code, this is how the logic goes:

    wp-blog-header
    -> wp-config
    -> -> wp-settings

    wp-settings creates the 3 main objects, $wp, $wp_query, and $wp_rewrite

    The functions.php for your template is then loaded. Here’s the kicker though. There’s been no query parsing yet, so you can’t use the conditional checks to see what page is being loaded. In fact, setting anything here in relation to the current request is useless, because when the $wp object is initialized, it will totally erase what you set.

    Now after wp-settings is done loading, we go back to wp-blog-header. The reason of the logic is as such:

    wp-blog-header

    -> the $wp object is initialized.
    -> wp-template-loader

    As you can see the $wp object is initialized before the templates are loaded, thus querying the database at the same time for the appropriate posts.

    As far as I can tell, to properly change the way your posts are being displayed without doing a second database hit (different order, whatever), you’ll have to either create a plugin, or add an action in your template’s functions.php page. You can then hook into the “pre_get_posts” action, which will allow you to change the query vars in $wp_query.

    So basically, no, I don’t believe you can just “edit the existing loop”.

    Thread Starter wyrd33

    (@wyrd33)

    So that’d be a no? ?? The problem with doing a customized loop in “category-6.php” would be that WordPress would have to query the database twice. Unless I’m way off base, when WordPress loads up category-6.php, it’s already done the query for the posts to display. If I wanted to display them in a different order, I’d have to requery the database. That’s not very efficient.

    Thread Starter wyrd33

    (@wyrd33)

    A breadcrumb is a form of navigation that leads from the current users location back to your home page URL. For example:

    Home > Projects > Blackjack
    or
    Home > Search > PHP > Page 2

    That’s a breadcrumb. It’s useful for larger sites that have deeply nested pages. You can see examples of it on my web site and also Nazgul’s web site. Although Nazgul’s is harder to spot, because he did something very nifty with his. ??

    Thread Starter wyrd33

    (@wyrd33)

    Alright, I went ahead and added your feature request, another crumb (for paging), and fixed a few bugs. Version is now 0.4:

    Added current page crumb, added text before current crumb (users location) option, fixed home page crumb while paging, fixed 404 crumb, fixed month link, fixed day link.

    Feel free to hit me with any other feature requests that you might have.

    You can list child pages like so:

    <?php if ($subpages = wp_list_pages('title_li=&depth=1&echo=0&child_of='.$post->ID)) : ?>
    <p><strong>
    <ul>
    <?php echo $subpages; ?>
    </ul>
    </strong></p>
    <?php endif; ?>

    Thread Starter wyrd33

    (@wyrd33)

    Nazgul:
    I can probly swing that feature, sure. Sounds like it’d be a useful one.

    The syntax highlighting are from a GeSHi plugin that I made. GeSHi is a free syntax highlighter (found here: https://qbnz.com/highlighter/ ) and I simply plugged it into WordPress. I’ve had to fight endlessly with the way WordPress filters page content, though, and I’ve also had to turn off their fancy editor.

    The plugin isn’t anything special, I do believe there are quite a few syntax highlight plugins already available in the plugin directory on this site.

    In your styles.css, try #sidebar a, #footer a { text-decoration: none; }

    Thread Starter wyrd33

    (@wyrd33)

    Ah thank you sir. Fixed. rsort worked fine, it was just that I forgot to assign the return value. Silly me. ?? Just to be safe, I also changed rsort to array_reverse.

    Maybe you can create a bunch of user accounts, and mark them as authors. You should then be able to select a different author when writing a post under “Post Author” on the right hand side menu (it’s the last item).

    Thread Starter wyrd33

    (@wyrd33)

    An update: I made the breadcrumb filter based. You can now highly customize it to your needs, and other plugins can extend the breadcrumb with ease. Further information at https://www.thedevproject.com/projects/wordpress-breadcrumb-plugin/

    In response to above:

    I like breadcrumbs because they offer better navigation when the user is deep within your site.

    I don’t think “breadcrumb” really needs any explanation. Every other CMS offers breadcrumb support, so it’s a pretty widely used term.

    Considering his whole site is based off of that plugin, I can understand why he wouldn’t want to freely give it away.

    The design looks great IMO. Simple, elegant, easy to read. Maybe the font size on the main content is a bit small, but that’s just my taste. It seems like resolutions are getting bigger and fonts are getting smaller. I’d like to see you try a bigger font (just for the main content, the rest of the font is fine).

    The sections look a bit empty (for the record, album reviews, etc), because of all the white space. Maybe if you could do something about that (maybe a picture or two) it’d look a bit more meaty.

Viewing 15 replies - 16 through 30 (of 48 total)