Forum Replies Created

Viewing 15 replies - 16 through 30 (of 68 total)
  • Thread Starter get_username

    (@get_username)

    I’ve also made sure that my custom post_type name is all lowercase and no spaces or dashes. My custom taxonomy is also all all lowercase and single word.

    Thread Starter get_username

    (@get_username)

    I just read that I should have

    'has_archive' => true

    set in my function and so I did set this. Unfortunately, this did not fix the problem.

    Thread Starter get_username

    (@get_username)

    I personally went ahead and made a category.php page and tag.php page for my standard posts which seem to work. The custom post type appears to be a little trickier. For some reason my taxonomy.php template is not recognized like the others. It sure would be nice to get other users opinions on this.

    Thread Starter get_username

    (@get_username)

    Can anyone tell me why using the Menu Panel had no affect on my redirect in the code above, but when sorting using the Page Attributes it did work?

    Thread Starter get_username

    (@get_username)

    This issue has been resolved. I tested the code above on a category page and it works there as well. No need for a plugin as I believe it’s just a matter of calling the correct query. Glad I figured this one out, as these forums are pretty quiet when it comes to help.

    Hopefully this helps others that might have the same problem.

    Thread Starter get_username

    (@get_username)

    I should have noted the archive.php page. Is that something I should use for filtering all categories and tags? I hesitate because I have blog posts, and then I have custom post type posts.

    Thread Starter get_username

    (@get_username)

    So after a little more searching I did find this, and it works with my blog section. Apparently you have to input this into your query. Unfortunately, all the WordPress books I have been reading do not mention this. It is, however, hidden within the WordPress query_posts documentation under subhead Pagination.

    query_posts( array( 'cat' => 8, 'paged' => get_query_var('paged') ) );

    I will test this when I’m on my categories page and see if it does the same thing.

    Thread Starter get_username

    (@get_username)

    Thanks for the replay. I guess I’m not understanding why this wouldn’t work with WordPress built-in features? I’m not doing anything custom and am only adding what WordPress suggests to use when navigating a page.

    An update to my original posts shows that my blog page no longer works either. If I click on the Next page link(next_posts_link) it still shows the first page posts. It is no longer specific to categories.

    I would at least like to learn what I’m doing wrong, and find out the limitations to WordPress before installing a plugin to complicate matters. Hope you can understand that.

    Thread Starter get_username

    (@get_username)

    Is there any way to resolve this without a plugin? In not doing anything outside the normal usage of WordPress.

    Thread Starter get_username

    (@get_username)

    Thanks, govpatel. Maybe you can help answer this similar question. I’m redirecting the top level page to the first child page with this code.

    <?php
    /*
    Template Name: Redirect To First Child
    */
    if (have_posts()) {
      while (have_posts()) {
        the_post();
        $pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
        $firstchild = $pagekids[0];
        wp_redirect(get_permalink($firstchild->ID));
      }
    }
    ?>

    This works if I use the Page Attributes Order numbering, but it does not work if I rely on the Menu Panel order. For example, in the Menu Panel I have my first child page directly under the parent page, yet, it goes to the 3rd or 4th child page instead. Thoughts?

    Thread Starter get_username

    (@get_username)

    Ok, so this doesn’t work based on my order as seen in the Menu admin panel, but oddly enough, if I add a number to the Page Attributes it does work. What is the difference between Page Attributes Order, and the Menus panel? Like I said, I have another site that uses this and all of the pages Page Attributes are set to zero (0). Can anyone offer some help?

    [ Please do not bump, that’s not permitted here. ]

    Thread Starter get_username

    (@get_username)

    Thanks, Kevin. I haven’t had a chance to test it yet, but I do appreciate your efforts in finding this solution.

    Thanks,
    Burt

    Thread Starter get_username

    (@get_username)

    It looks like this works, but was wondering if there is a way to do it at the function level.

    ul.blogroll a {
        display: block;
    }

    Thread Starter get_username

    (@get_username)

    Hey Kevin,

    Thanks for sticking with this. I appreciate it. I ended up trying some custom meta boxes, which I’ve built into the Page write panel. The problem is that I can’t pull this custom meta.

    Here’s my first attempt with a wp_query loop

    <?php
    $testimonial_query = new WP_Query(array('post_type=page'));
    while ( $testimonial_query->have_posts() ) : $testimonial_query->the_post();
    ?>
    
    <p>"<?php $key_1_values = get_post_meta($post->ID, 'dbt_textarea'); ?>"</p>
    <h6><?php $key_2_values = get_post_meta($post->ID, 'dbt_text'); ?></h6>
    
    <?php
    endwhile;
    wp_reset_postdata();
    ?>

    I then tried the standard loop

    <?php
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <p><?php $key_1_values = get_post_meta($post->ID, 'dbt_textarea'); ?></p>
    <h6><?php $key_2_values = get_post_meta($post->ID, 'dbt_text'); ?></h6>
    
    <?php
    endwhile;
    endif;
    ?>

    I’m not sure why it’s not posting, but I figured having meta box on the page would be more intuitive for the client(user). Thoughts if this is a good approach, and if so, why the meta boxes aren’t showing content on the live page?

    Thread Starter get_username

    (@get_username)

    Here is my code that I was trying to use to query a custom post type.

    <?php
    // Query Testimonial
    $testimonial_query = new WP_Query('post_type=testimonial');
    while ( $testimonial_query->have_posts() ) : $testimonial_query->the_post();
    ?>
    <?php the_content(); ?>
    
    <?php
    endwhile;
    wp_reset_postdata();
    ?>

    I thought this might work, but I have no way of knowing what to put in the value field so that it grabs the post with the unique identifier.

Viewing 15 replies - 16 through 30 (of 68 total)