logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$25
alphabetized posts like wp-snap

Hi folks

I need a fix for the plugin WP-Snap or way to get the functionality of the plugin through hardcoding. My problems with the plugin are:

1. the category template page where I use the plugin doesn't create pages of 10 posts apiece as I've selected in the Wordpress settings.
2. Adding "query posts" coding to limit the number of posts displayed causes wp-snap to break and no longer display only posts starting with a certain letter.
3. Since I moved from my MAMP server to 1and1 hosting I get errors when I use the "firstload=recent" option and the cursor won't change to a hand when mousing over the letters (I can live with that though it may be indicative of a larger problem).

A fix would be best as WP-Snap provides a lot of great options but ultimately I just need to get something functional.

The offending page can be found here http://www.ksuptemp.com/?cat=5. It's built off the Branford Magazine theme

thanks

This question has been answered.

darryl crosby | 12/21/10 at 10:47am Edit
Tutorial: How to assign prize money

Previous versions of this question: 12/21/10 at 11:04am

The experts have suggested, on average, a prize of $50 for this question.

(4) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    12/21/10
    10:57am
    Joe Jenkins says:

    It doesn't give you the bar with the letters, but a great way to get alphabeticised posts shown is by using this plugin:

    http://web-argument.com/wordpress-alphabetical-list-plugin

    You get to choose which categories to use it on, and it is the one I'm using to create a publisher's site.

  • avatar
    Last edited:
    12/21/10
    11:03am
    Chris Lee says:

    I have no idea what the code looks like so i can only provide you what the query code would be as throwing darts blindfolded.

    If you want to sort the posts by title:


    <?php $q = new WP_Query(
    'orderby'=>'title',
    'postsperpage' =>'-1',
    'numberposts', =>'-1',
    'post_status'=>'published'
    );
    ?>


    Then you'll want to do the typical loop & reference your query:


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



    Previous versions of this answer: 12/21/10 at 11:03am

    • 12/21/10 11:19am

      darryl crosby says:

      the first bit of code causes a syntax error in the "orderby" line

  • avatar
    Last edited:
    12/22/10
    2:19pm
    Chris Bavota says:

    The plugin obviously doesn't have a pagination script built in so your "All" page will just list all your posts without breaking them up in pages. It would probably take a bit of re-writing to go in and add the functionality, and then you would never be able to upgrade the plugin since that would overwrite the mod.

    This piece of CSS is causing your cursor to turn to the text icon:

    ol.snap_nav li.snap_selected a {
    cursor: text;
    }


    It is on line 134 in the nav.css file.

  • avatar
    Last edited:
    12/22/10
    2:19pm
    rilwis says:

    This plugin gets all posts using raw query, then modify (not using query_post function) global variable $wp_query to assign matched posts.

    To display correct number of posts, I added this code below to line 410:

    $paged = get_query_var('paged');
    $paged = empty($paged) ? 1 : $paged;
    $posts_per_page = get_option('posts_per_page');
    $offset = ($paged - 1) * $posts_per_page;

    $wp_query->max_num_pages = ceil(count($all_posts) / $posts_per_page);

    $all_posts = array_slice($all_posts, $offset, $posts_per_page);


    You can grab the full file here: http://pastebin.com/WxTP7kqY

    Previous versions of this answer: 12/21/10 at 9:55pm

This question has expired.





Current status of this question: Completed



Please log in to add additional discourse to this page.





Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.