Forum Replies Created

Viewing 15 replies - 31 through 45 (of 58 total)
  • I was right, updating WP-SNAP! to include the ability to work on Pages was a… snap. One line of code and BAM! An exciting world of new possibilities.

    Get WP-SNAP! version 0.2 right here:

    https://www.nateomedia.com/wordpress/wp-snap

    Yes, WP-SNAP! was created specifically for use in categories, but I certainly could modify it to work with pages as well. I’ll add it to my to-do list. ??

    (Actually, thinking about it, I think it would only take about one line of code… I’ll tinker later tonight.)

    To anyone in need of an alphabet-based post navigation menu, I have transformed this code into a plugin.

    https://www.nateomedia.com/wordpress/wp-snap

    You say you’re using the default theme but then go onto say that “my links” are not working — rather than “the theme’s links” — does this mean that you’ve made changes to the theme? Does the theme work without modification?

    As far as urls go, I tried the permalink structure and couldn’t really get it to work either, but really didn’t care. This is what I put for structure:

    ‘/index.php?p=%post_id%’

    Give it a shot.

    Beyond that, I would suggest making your php files available.

    By the way, if your friends are still in Kauai, tell them to go to a restaurant called The Blossuming Lotus. It’s a must visit (especially if they’re into healthy foods).

    Thread Starter nateomedia

    (@nateomedia)

    Ah, very simple. Just add this to the form:

    <input type="hidden" name="redirect_to" value="index.php?p=<?php echo $id; ?>" />

    Thread Starter nateomedia

    (@nateomedia)

    I figured it out. Simple trick, actually. Basically, I put an if statement on the single.php page and used $_GET to determine what part of the post got displayed (ie, article, comments, or coment form). Here’s the basic structure:

    <?php while ( have_posts() ) : the_post(); ?>
    <?php if ( ( $_GET['read'] == NULL ) && ( $_GET['write'] == NULL ) ) { ?>
    <?php the_content(); ?>
    <?php } elseif ( $_GET['write'] == 'true' ) {
    if ('open' == $post->comment_status) { ?>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="f_article_comment">
    <?php do_action('comment_form', $post->ID); ?>
    </form>
    <?php }
    }
    if ( $_GET['write'] == NULL ) { ?>
    <?php comment_text(); ?>
    <?php } endwhile; ?>

    Then, to pass write or read to the url, create your links like this:

    <li><a href="index.php?p=<?php echo $_GET['p']; ?>&read=true">Read Comments Made</a></li>
    <li><a href="index.php?p=<?php echo $_GET['p']; ?>&write=true">Write A Comment</a></li>

    Voila!

    Still working out some small issues … trying to figure out how to pull write=true from the url after a comment is submitted. Need to do a little more tinkering.

    Haven’t actually implemented the custom comment field yet… the solutions I’ve seen require changing the wp code… maybe it time to learn how to make a pluggin (if this is possible).

    Thread Starter nateomedia

    (@nateomedia)

    Bump. Anyone able to shed some light on this? I’ve found info on how to add fields to display the user’s location, but not the rest. Thanks.

    Do you plan to have empty categories? Why? This sounds like a bug in any case, but try posting some content to each category you call and see if that fixes things. Since you probably won’t have empty categories, it sounds like this might solve your problem.

    Forum: Plugins
    In reply to: Assign categories to Pages?

    I didn’t completely understand the initial request. The only thought I can offer is that you could hardcode your WordPress Help Page into your WP category template (if you’ve got a separate template for WP), otherwise you could use a conditional statement to get the link to appear — if ( is_category ( '#' ) ) { echo "<a>WordPress Help</a>" }.

    Forum: Plugins
    In reply to: Assign categories to Pages?

    Uh, why not just make “wordpress help” a category?

    Ah ha!

    <?php
    ob_start();
    get_links_list('order');
    $string = ob_get_contents();
    ob_end_clean();
    ob_end_flush();
    $patterns[0] = '/echo/';
    $patterns[1] = '/h2/';
    $replacements[0] = '';
    $replacements[1] = 'h3';
    preg_replace( $patterns, $replacements, $string );
    ?>

    So, are posts showing up correctly for the loop? Is the problem just with your asides? Maybe you need to rewind the loop for your asides?

    Gah! I’m trying to get this to work, but I’m stuck. I did some digging and rewrote the code thusly:

    <?php
    $string = get_links_list('order');
    $pattern = '/<h2>(.*?)</h2>/';
    $replacement = '<h3>\\1</h3>';
    echo preg_replace( $pattern, $replacement, $string );
    ?>

    For the life of me, I cannot get it to work. I’ve even tried running very simple preg_replace queries and they aren’t working. I’m missing something.

    Maybe post your loop?

    Works for me. You are, of course, substituting in your category numbers, correct?

    Here’s the whole structure of the loop I’m running:

    <?php
    $posts = 3; //Number of posts to display
    query_posts('cat=##,##,##,##&showposts='.$posts);
    while ( have_posts() ) : the_post(); { ?>

    //Insert article content here

    <?php } endwhile; ?> //

    I use $posts as a counter in the loop so that the last post can have a special css class.

Viewing 15 replies - 31 through 45 (of 58 total)