Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Adz

    (@adz)

    Bump.
    Sorry, but I’m still looking for an answer.

    Thread Starter Adz

    (@adz)

    Thank you Zeo. I initially left the posts_per_page in the query string which gave me an odd result – I could get to page 2, but not 3. Once I removed that, it worked perfectly. Thanks again.

    Thread Starter Adz

    (@adz)

    @zeo – I have no idea what sort of filter you want me to create and what to do with it. Could you explain it please?

    Thread Starter Adz

    (@adz)

    @alchymyth – Thanks for the idea, but I’ve already tried that. It didn’t make a difference. Just for the sake of testing, I also tried navigating to domainroot/2010/?paged=2 but still no luck.

    Thread Starter Adz

    (@adz)

    @hiroaki Miyashita – Thank you!! It works beautifully!

    Thread Starter Adz

    (@adz)

    It’s decided to use the index.php template rather than archive.php so for some reason, it’s not detecting that it’s an archive. I don’t think the problem is with posts_nav_link() but I don’t have a clue what the problem is.

    Thread Starter Adz

    (@adz)

    archive.php

    <?php get_header(); ?>
    <div id="container">
        <?php get_sidebar(); ?>
    
    	<div id="rightcolumn" class="rightcolumn">
        	<?php  query_posts($query_string . '&posts_per_page=2'); ?>
    		<?php if ( have_posts() ) : ?>
            <?php while ( have_posts() ) : the_post(); ?>
            	<div class="post" id="post-<?php echo $post->ID ?>">
                    <?php edit_post_link('[Edit]', '<div class="edit">', '</div>'); ?>
                    <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                    <span class="archiveCatName">
                    <?php
    					foreach((get_the_category()) as $category) {
    						echo(get_category_parents($category->cat_ID ,TRUE, ' '));
    						echo '<br />';
    					} 
    
    				?>
    				</span>
                    <span class="newsDate"><?php the_time('l, F jS Y') ?></span>
    
    			</div><!--End Post-->
    		<?php endwhile;
    		posts_nav_link();
    		else: ?>
    			<h2>Page Not Found</h2>
    			<p>Sorry, the page you were looking for could not be found.</p>
    		<?php endif; ?>
        </div> <!--End Right Column-->
        <br />
        </div> <!--End Container-->
       <?php get_footer(); ?>

    I’m using it without any parameters at the moment until I can get it working properly.

    Thread Starter Adz

    (@adz)

    Sorry to bump my own thread, but anyone have any ideas?

    Thread Starter Adz

    (@adz)

    @mpez, this may be a stupid question, but did you add singleList = true to the template?

    Thread Starter Adz

    (@adz)

    @elseudomini.net – I was thinking of doing that, but decided against it because I wasn’t too keen on the idea of removing functionality. But as you said, it works.

    http://codex.ww.wp.xz.cn/Template_Tags/wp_list_comments
    You’ll have to create a callback function, as far as I can tell, unless there’s a simpler method.
    There’s an example in the link above. If you want to keep everything else the same as the default, just remove or comment out the part that says:
    <?php printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?>

    Simpler method: if your theme uses a class name for the date/time, you can use CSS to just hide it. For example, if the markup is:
    <span class="commentDateTime">15 April 2010 at 01:23</span>
    You can add this to your CSS:
    .commentDateTime { display:none }

    Thread Starter Adz

    (@adz)

    Okay, it stores the values in arrays, which is why it lists the output rather than just a string.
    So, I tried a rough hack to create a new option called stripTags and put:

    if ( $val['stripTags'] == true ) :
    $replace_val = trim(strip_tags($replace_val));
    endif;

    after

    if ( $val['singleList'] == true ) :
    $replace_val = '<ul><li>' . $replace_val . '</li></ul>';
    endif;

    in custom-field-template.php but that didn’t do anything.

    So I just added

    $output = trim(strip_tags($output));

    before the return in:

    if ( $metakey ) :
    			$metavalue = $this->get_post_meta($post_id, $key, $single);
    			if ( is_array($metavalue) ) :
    				$output = '<ul>' . "\n";
    				foreach ( $metavalue as $val ) :
    					$output .= '<li>' . $val . '</li>' . "\n";
    				endforeach;
    				$output .= '</ul>' . "\n";
    			else :
    				$output = $metavalue;
    			endif;
    			$output = trim(strip_tags($output));
    			return $output;
    		endif;

    I know there’s a simpler way without changing the code, because I’ve done it before. I just can’t figure it out :s

    I was trying to output all of the terms from a taxonomy and ended up with something like this. I made a few changes to suit your situation. Though I haven’t tried it, I’d hope it works.

    <?php
    //Your code:
    $terms = get_the_terms($post->ID, 'cuisine_type');
    print_r($terms);
    
    //my code
    foreach ($terms as $taxindex => $taxitem) {
      if ($taxindex=='name') {
    ?>
     <span><?php echo $taxitem; ?></span>
    <?
      } //end if
    } // end foreach
    ?>

    In theory, your code would give you the array you posted earlier. Then my code would loop through the array and for each index that matches ‘name’ (which is where “Mexican” would be stored) will echo the value.

    Hope that helps.

    Hi,
    I’m not entirely certain about this, but I had a somewhat similar issue with accessing a theme options pages.

    The widget is in the widgets.php file, right? Open it up and look for a header redirect. I don’t recall the code by memory, but it’ll be something like header('location:http:/:....') It’ll probably end in themes.php. Change that to widgets.php and hopefully it will start working.

    Hope that helps.

    Try this:
    <?php echo $terms['name']; ?>
    That specifies exactly which index you want from the array.

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