dadvan
Forum Replies Created
-
Please elaborate
Forum: Fixing WordPress
In reply to: Most Recent Post Per Categorytry this:
<?php include_once (TEMPLATEPATH . '/title.php');?> <?php $values = get_post_custom_values("category-include"); $cat=$values[0]; ?> <?php global $more; $more = 0;?> <?php $wp_query = new WP_Query(); ?> <?php $catinclude = 'portfoliocat='. $cat ;?> <?php $wp_query->query("post_type=portfolio" . '&' . $catinclude .' &paged='.$paged.'&posts_per_page=-1&orderby=date&order=DESC'); ?> <?php get_template_part( 'loop', 'portfolio' );?>Forum: Hacks
In reply to: Dynamic Link from WP_QuerySo I replaced this:
<a href="/tag/<?php $my_query->post_name?>">See All Related Articles</a>With this:
<a href="/tag/<?php echo $post->post_name; ?>">See All Related Articles</a>I also moved it after:
<?php wp_reset_postdata(); ?>Hope this helps someone!
Forum: Hacks
In reply to: Search on Page SlugOK, So i inputted this in the value and now it will search in a tag that matches the page slug:
<?php echo $post->post_name; ?>Hope this helps someone!
Forum: Hacks
In reply to: Search on Page SlugI am able to search within the tag group with this:
<form method="get" id="search form" action="/"> <div> <input type="text" value="" name="s" id="s" /> <input type="hidden" value="consulting" name="tag" id="post_tag" /> <input type="submit" id="search_submit" name="Search" value="Search"/> </div> </form>How can I pull in the page slug as the value in the hidden field?
Forum: Fixing WordPress
In reply to: numberofposts not working in get_postsTry this:
<ul> <?php global $post; $args = array( 'numberposts' => 5, 'category' => 5 ); $catPosts = get_posts( $args ); foreach( $catPosts as $post ) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> echo count($catPosts); </ul>Forum: Fixing WordPress
In reply to: Custom FieldsI am scratching using the custom field. Thanks for the reply!
Forum: Plugins
In reply to: [Posts By Tag] [Plugin: Posts By Tag] Paginationjust seen the post that that you stated that this feature is not supported. You should include in a future release.
I am looking for this too along with the post author. Any assistance would be greatly appreciated.
ability to search only the related posts
Forum: Plugins
In reply to: Related posts and Search in sidebarI found this code which I put in functions.php
function wp_search_form($form) { global $wp_query; $form = '<form method="get" id="searchform" action="' . get_option('home') . '/" > <input type="hidden" name="cat" value="'. $wp_query->get_queried_object_id() .'" /> <input type="text" class="search_input" value="' . attribute_escape(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> <input type="submit" alt="Search" class="greybutton float_right" value="Search" /> </div> </form>'; return $form; }And I put this in my page template: <?php wp_search_form(); ?>
But the place where I am expecting to see the form show up is comping up blank.
Am missing something or is the code I found no good?
Forum: Themes and Templates
In reply to: Pages show instead of Posts in Blogcode is here:
I have this exact same issue with a fresh install of WP 3.3.1 and BP 1.5.3.1. I can not add events or see the events page.