marcusgee
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?Never mind–I found what I was looking for, and it works pretty well. Here’s the code:
<?php $catslug = get_post_meta($post->ID, 'catslug', TRUE); $cat = get_post_meta($post->ID, catslug, TRUE); ?> <?php query_posts( 'category_name=' . $cat ); ?> <?php while (have_posts()) : the_post(); ?> <h3><?php the_title(); ?></h3> <?php endwhile;?>Where “catslug” takes the place of “Attorney Slug” as the name of the custom field. Thanks for all the help!
Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?Well, I figured out how to call and display the Attorney Slug custom field I created:
<?php if ( get_post_meta($post->ID, 'Attorney Slug', true) ) : ?> <?php echo get_post_meta($post->ID, 'Attorney Slug', true) ?> <?php endif; ?>Now the question is: what’s the code to display the category that I call in the above code?
Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?How might the code for that look if I created a custom field called “Attorney Slug” that was exactly the same as the category slug? I imagine it would involve php echo get_posts, wouldn’t it?
Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?How about adding the category slug as a custom field on each bio page? It wouldn’t be a big deal to add it. Could we then use that to call the category?
Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?I was wondering if it was possible to incorporate <?php the_title(); ?> as a variable in pulling up the posts for an individual category. Since “Homer Hickham” is also the title of the page and the name of the category, would it be possible to use <?php the_title(); ?>
as a variable to do this?Forum: Fixing WordPress
In reply to: Displaying posts in sidebar based on page title?Thanks, esmi! Is there a tutorial on how to implement, though? Checking the codex still left me a bit confused.
Forum: Fixing WordPress
In reply to: Displaying different posts on different pages in the sidebarWell, the trick is that a lot of times the posts won’t be authored by the person in question. It’ll just be about that person, and typically authored by me. That’s why I was hoping there was a way to reference the tag.
Ideally, I’d like to tag a post as “John Smith” and then have anything tagged as him appear in the posts section of the sidebar.