Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Well, I decided to take a raw DIY approach and used a few of my own variables, queries, and loops to accomplish my particular goal; using specific knowledge of how and where certain data is stored in the WP database.

    <div id="gig_schedule">
    <h4>Gig Schedule</h4>

    <?php $gig_query = mysql_query("SELECT post_id FROM wp_postmeta ORDER BY meta_value ASC"); ?>

    <ul>
    <?php
    while ($query1 = mysql_fetch_array($gig_query)) {

    $title = mysql_result(mysql_query("SELECT post_title FROM wp_posts WHERE ID='$query1[post_id]'"), 0);
    $url = mysql_result(mysql_query("SELECT guid FROM wp_posts WHERE ID='$query1[post_id]'"), 0);

    echo "<li><a href="$url">$title</a></li>n";

    }
    ?>
    </ul>
    </div>

    As you can see, it’s not integrated into WP at all, so it cannot be used as a plugin in its current state (also because it obviously caters only to my specific needs, though I imagine it could easily be altered to take other needs and situations into account). Also, because it works completely separately from WP, this happened to solve my other problem with using blog pages with multiple loops.

    If anyone has any suggestions as to how this could be improved or integrated into WP better, please do reply.

    I too have a similar problem. On the website I run for a band, I list all their upcoming gigs using a seperate loop from the main loop, on the main page. The date for the upcoming gigs are custom fields, and I’d like to sort these posts in descending alphabetical order by their custom field values.

    Here’s the code for that partiular loop:
    <?php $my_query = new WP_Query('category_name=Gigs&showposts=10'); ?>

    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <p><b><?php echo get_post_meta($post->ID, date, true); ?></b> - <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></p>
    <?php endwhile; ?>

    I’m sure it’s just something simple that needs to be added to the WP_Query, but I don’t know what. Any help would be much appreciated.

    Thread Starter mrd516

    (@mrd516)

    Another thing I’m noticing is that the posts limit isn’t working quite right either. I’m not sure I’ve identified any particular pattern, it’s just not working how it should.

    This is very strange and even more frustrating. My code is exactly how it is suggested on the Wiki, so why are there so many problems???

    I’m tempted to just forget about the pagination and hard-code the post limit. That seemed to have much fewer problems.

    Thread Starter mrd516

    (@mrd516)

    The navigation links do not show up, meaning the navigation div is empty when I view the source code.

    Thread Starter mrd516

    (@mrd516)

    When I tried the plugin I got a bunch of errors and my 2nd loop didn’t even work, though the main loop did. I think I was closer to the solution without this plugin.

    I don’t have any other plugins activated.

    I don’t see the need for you to “dive” into my blog, I’ve pasted all of the code from my index file, for you and everyone else to see. I’d really appreciate it if someone could just examine the code and figure out what the problem is.

    Thread Starter mrd516

    (@mrd516)

    Well, I tried the plugin, and it only generated a slew of database errors. I think I was closer to the solution without it.

    Next suggestion?

    Thread Starter mrd516

    (@mrd516)

    Okay, I replaced the Kubrick theme format for posts navigation with the posts_nav_link function, and no difference (just as I expected).

    Thread Starter mrd516

    (@mrd516)

    It seems rather unnecessary to use a plugin to only display posts of a particular category within the main loop. Wouldn’t it be easier to just put an if test within the loop to accomplish this?

    Anyway, I’ve altered my index file as follows, and now the Previous/Next Entries links just don’t show up at all.

    <?php get_header(); ?>

    <div class="gig_schedule">
    <h4>Gig Schedule</h4>

    <?php $my_query = new WP_Query('category_name=Gigs&showposts=10'); ?>

    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <b><?php echo get_post_meta($post->ID, date, true); ?></b> - <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>

    <?php endwhile; ?>

    </div>

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

    <?php if (in_category('1')) { ?>
    <h3><?php the_title(); ?></h3>
    <?php the_content(); ?>
    <p class="cite"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent link for <?php the_title(); ?>">#</a> | Posted by <?php the_author() ?> on <?php the_date() ?> | <?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    <?php } ?>

    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
    </div>

    <?php else : ?>

    <?php endif; ?>

    <div class="meta">
    <a href="wp-rss2.php" title="Syndicate this site with RSS 2.0"><img src="rss2.gif" alt="Rss 2.0" /></a> <a href="wp-atom.php" title="Syndicate this site with Atom 0.3"><img src="atom03.gif" alt="Atom 0.3" /></a> <a href="https://www.ads-software.com&quot; title="Powered by WordPress"><img src="wordpress.gif" alt="WordPress" /></a>
    </div>

    <?php get_footer(); ?>

    Thread Starter mrd516

    (@mrd516)

    It’s been a week now, and still no help. This issue still needs to be resolved and I’d really appreciate some advice here.

    Thread Starter mrd516

    (@mrd516)

    It’s been about 2 days and this post is already completely buried. I, and atleast one other person would really appreciate some assistance with this.

    I’m sorry if I’ve violated any sort of “no bumping” rule, but I felt it was necessary.

    Thread Starter mrd516

    (@mrd516)

    Yes, I have read the multiple loops documentation. That’s how I learned how to use multiple loops in the first place.

    The pagination is not working. I set the limit for the number of posts per page, it displays the newest of that limit (whether it be, 1, 5, 10, etc.), and when I click the “Previous entries” link it simply doesn’t change anything.

    Forum: Fixing WordPress
    In reply to: Archives Drop-down

    Okay… I just replaced the button with a regular <input> button, and now it works. How does this make ANY sense? I was under the impression <button>’s were supposed to behave the exact same way as <input type=”button” />’s. Anyone have any ideas?

    EDIT: I tried using the <button> method again. This time using the type=”button” attribute, and now it behaves as it should. Weird.

    Forum: Fixing WordPress
    In reply to: Archives Drop-down

    It still doesn’t work. When I select an option all it does is relocate me to the URL in the form action.

    Here’s my new code:
    <form name="archiveform" action="wp/index.php" method="post">
    <select name="archive_chrono">
    <option value="">Select Month</option><?php get_archives("monthly","","option","","",false); ?>
    </select>
    <button onclick="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">Go</button>
    </form>

    Forum: Fixing WordPress
    In reply to: Archives Drop-down

    Uh, okay…

    That post you linked me to didn’t answer any part of my question. All you said was that there is absolutely no way to accomplish this without JavaScript (which I remain very skeptical of), and you mentioned a way to do this using a form button, but there’s no code to show it. Care to share that code here?

    And isn’t there already a plugin for categories that does exactly what I’m looking for, that doesn’t use JavaScript? Why can’t a plugin that’s identical to this be created for archives?

    Forum: Fixing WordPress
    In reply to: Archives Drop-down

    Okay, I too am trying to implement this. I copied the code from this thread completely as-is, and it worked perfectly. The thing is, I want to use a button in conjunction with the option menu, instead of an option immediately taking affect when selected. I assumed all I needed to do was move the “onchange” attribute to a button and change it to “onclick”, but for some reason it does not work.

    Here is my code:
    <form name="archiveform" action="">
    <select name="archive_chrono">
    <option value="">Select Month</option><?php get_archives("monthly","","option","","",false); ?>
    </select>
    <button type="submit" onclick="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">Go</button>
    </form>

    If anyone could shed some light on this I would appreciate it.

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