Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Forum: Hacks
    In reply to: Numbering IDs
    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Okay, I just said screw it and used <?php the_ID(); ?>

    Kinda sloppy, but it works.

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Cool post, but it doesn’t address what i’m talking about. What I want to end up with is this:

    <div class="nav-previous"><a href="the-prev-post-title" title="Previous Post: The Prev Post Title">&larr; Previous Post</a></div>
    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Thanks guys. If anyone’s trying to do the same thing, here’s the final code:

    <?php
    	$branding = get_category('7');
    	$branding_count =  $branding->category_count;
    	$next_id = $my_post_count+1;
    	$next_post = get_previous_post(true);
    	$next_title = $next_post->post_title;
    
    		if ( $next_id > $branding_count ) {
    		}
    
    		elseif ( $next_id == 2 ) {
    			echo '<a href="#project-' . $next_id . '" "class="slide next button" title="Next Project: ' . $next_title . '">Next Project &darr;</a>';
    		}
    
    		elseif ( $next_id <= $branding_count ) {
    			echo '<a href="#project-' . $next_id . '" "class="slide next button" title="Next Project: ' . $next_title . '">&darr;</a>';
    		}
    ?>
    
    <?php
    	$previous_id = $my_post_count-1;
    	$previous_post = get_next_post(true);
    	$previous_title = $previous_post->post_title;
    
    		if ( $previous_id > 1 ) {
    			echo '<a href="#project-' . $previous_id . '" "class="slide previous button" title="Next Project: ' . $previous_title . '">&uarr;</a>';
    		}
    
    		elseif ( $previous_id == 1 ) {
    			echo '<a href="#masthead" "class="slide previous button" title="Next Project: ' . $previous_title . '">&uarr;</a>';
    		}
    
    		elseif ( $previous_id == 0 ) {
    		}
    ?>
    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    If anyone’s curious, I found this, which seems to work perfectly:
    https://www.nullcore.nl/100/using-a-custom-taxonomy-to-display-related-posts/

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Oh, another thing that may or may not be important. This is all in a Post Type called ‘work’ and not part of the standard posts.

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    It doesn’t seem to be working. A couple questions:

    1. Does it need to be inside or outside the loop? I’ve tried it both ways.
    2. Do I need to use a post rewind function?
    3. I notice you have the taxonomy using plural in one place and singular in another. The taxonomy is ‘clients’ and the singular is ‘client’.

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Thanks a bunch. I haven’t tried it yet, but it makes perfect sense. Thanks!

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Comments.php contains the formatting for the comments themselves. What I’m looking for is the formatting of the comment form a user fills out to post a comment.

    Thread Starter drinkonlyscotch

    (@drinkonlyscotch)

    Obviously, I would like to avoid requiring the author to paste code into posts with recipes, which would also require a php-exec plug-in or something similar.

    The plug-in totally works, though it took me a few minutes to figure out what I was doing wrong. Basically, when you’re adding/excluding certain pages, you simply enter the name of the page, with no slashes. The note beneath it pertaining to the use of slashes is only relevant when you’re adding/excluding subpages.

    For example:
    If I want to have a widget only appear on the “Bicycles” page, I simply enter:

    bicycles

    But if I want the widget to appear on subpages of the “Bicycles” page, I enter:

    bicycles/*

    Hope that helps.

    Kaspars, great plug-in, but you could definitely improve the documentation. It’s super easy to use, but it doesn’t seem that way at first glance.

Viewing 10 replies - 1 through 10 (of 10 total)