WordPress.org

Ready to get started?Download WordPress

Forums

WP No Category Base
issue with WP No Category Base and the_permalink() (1 post)

  1. Rejo Zenger
    Member
    Posted 2 years ago #

    For my website, I am trying to create another sidebar block with a list of sticky posts.

    To create a (customized) widget in the sidebar with a list of postings that are marked sticky, I am using the following code:

    function featuredpostsList() {
              $sticky = get_option('sticky_posts');
              rsort( $sticky );
              query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) );
              ?>
            <div class="multi-sidebar clearfix">
                    <div id="s-featured" class="widgetcontainer clearfix">
                            <h5 class="widgettitle">Nu in de belangstelling</h5>
                            <ul class="sidebar-featured">
                                    <?php if (have_posts()) :  while (have_posts()) : the_post();
                                    $cats = get_the_category($post->ID);
                                    ?>
                                    <li class="clearfix">
                                            <span class="thumb"><?php the_post_thumbnail('sidebar-thumb'); ?></span>
                                            <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                                            <?php echo ucfirst($cats[0]->cat_name) ; ?>
                                    </li>
                                    <?php endwhile; endif; ?>
                            </ul>
                    </div>
            </div>
    <?php
    }

    As it may be possible the code is changed by the forum software, the code is also available here.

    This works like a charm, provided the "WP No Category Base" plugin is disabled or the line with the XXXX's is removed in the code above. When enabling the plugin and I have added the line marked with XXXX's, the page is broken. If I recall correctly, I can use the_permalink() or the_title(), but not in combination with the href tag.

    When broken, the page is loaded into itself, right after the if-loop in the example above. A screenshot is here (the article that is loaded into the page itself ("Ik, in de oven van T-Mobile" is the first of the sticky posts). After a few seconds, the page becomes blank.

    I am not sure if the problem is specifically with this plugin or elsewhere, but I am able to reproduce it by enabling and disabling this plugin. Any help is appreciated.

    To aid willing to help: I am running latest stable version of WordPress, latest stable version of Arras theme, latest stable version of WP No Category Base. The files from the Arras theme and my customization in the child theme may be downloaded from here.

    http://wordpress.org/extend/plugins/wp-no-category-base/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic