Forum Replies Created

Viewing 15 replies - 1 through 15 (of 49 total)
  • thebindlestick

    (@thebindlestick)

    My work around for <br> tags that don’t work is:

    <p>&nbsp;</p>

    seems to add a line break in most browsers.

    Thread Starter thebindlestick

    (@thebindlestick)

    The solution I ended up with after two days of banging my head into my monitor is that The Lop in my index and The Loop in my sidebar were interfering with eachother. I found this solution and it is the only thing I can get to work; see first and last lines of code specifically:

    <?php $temp_query = $wp_query; ?>
    <?php query_posts(‘cat=-5’); ?>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    — do stuff —

    <?php endwhile; ?>

    <?php endif; ?>
    <?php $wp_query = $temp_query; ?>

    Can anyone see why this is a bad idea in WP 2.1?

    Thread Starter thebindlestick

    (@thebindlestick)

    How about this:

    <?php query_posts('cat=-5'); ?>
    
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="rss" id="post-<?php the_ID(); ?>">
    
    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
    
    </div>
    
    <?php endwhile; ?>
    
    <?php endif; ?>

    That displays the correct list of posts in my sidebar but they all link to the post displayed on the main page, it is like the to query_posts interfere with eachother, is this the case?

    Thread Starter thebindlestick

    (@thebindlestick)

    On that page it says:

    ” Excluding Multiple Categories

    Note: You cannot exclude more than one category with query_posts. Therefore you can use workarounds or plugins.”

    Those work arounds are what I am looking for. I have tried conditional loops and they do not work. I am not looking for an if_home function, this is for my sidebar, to only display titles, not the entire post.

    thebindlestick

    (@thebindlestick)

    He has a 2.1 version, anyone using this? is there a way to hack this to exclude categories from the list on another page, i.e. right.php instead of sidebar.php?

    Thread Starter thebindlestick

    (@thebindlestick)

    Query_posts doesn’t have an exclusion option, AFAIK.

    thebindlestick

    (@thebindlestick)

    Either use pages (admin panel, manage pages) or go to /wp-content/themes/your-theme/sidebar.php and edit that file in the theme editor (presentation / theme editor)

    Thread Starter thebindlestick

    (@thebindlestick)

    I know how to do the opposite like this:

    $myposts = get_posts(‘numberposts=10&offset=1&category=5’);

    and display one category, but how do I display all BUT one?

    $myposts = get_posts(‘numberposts=10&offset=1&category!=5’);

    doesn;t work with the (!) in there.

    thebindlestick

    (@thebindlestick)

    Look in your Theme folder (wp-content/themes/your_theme_folder) and look in the index.php folder… somewhere after <?php if (have_posts()) : ?> there should be a category display…

    first though back up your index file to a separate folder in case ya mess it up.

    Thread Starter thebindlestick

    (@thebindlestick)

    anyone?

    Thread Starter thebindlestick

    (@thebindlestick)

    That don’t work for 2.1, plus I was looking for a simple non-plugin hack for it. I found it:

    <?php
    if (is_home()) {
    query_posts(“showposts=1”);
    }
    ?>

    thebindlestick

    (@thebindlestick)

    anything like that available for 2.1?

    Thread Starter thebindlestick

    (@thebindlestick)

    Sorry for my delayed response, it’s been too nice outside here in Seattle to stay online! Here is what I am using:

    <?php
    
    foreach ($recentposts as $post) {
    
    if ($post->post_title == '')
    
    $post->post_title = sprintf(__('Post #%s'), $post->ID);
    
    echo "<li><a href='".get_permalink($post->ID)."'>";
    
    the_title();
    
    echo '</a></li>';
    
    }
    
    ?>

    I’d like to limit the number of words that are displayed in the title, in the sidebar only, but not on the post’s page itself – limit it to what will fit on one line… not just truncate it to a certain character count; that’s easy.

    Like I said in my first post, if I have six words in the title but only four fit on a line before it is wrapped to the next line, I’d like it to stop after the fourth word and ad an ellipse (…) so if it is set to 31 characters maximum, it would change:

    WordPress Issues World Wide Press Release

    to

    WordPress Issues World Wide…

    but not just like 31 characters like this:

    WordPress Issues World Wide Pre

    So it finds 31 characters, then goes back to the end of the last word, and stops there and adds an ellipse, any ideas?

    Same here. My site goes from the WordPress index to a custom shopping cart, and the session ID is started on the first page of cart, but for some reason it isn’t working. It kicks me back to the index when the if statement in the session check fails.

    what is the new_link supposed to be, the table name?

Viewing 15 replies - 1 through 15 (of 49 total)