WordPress.org

Ready to get started?Download WordPress

Forums

I get 0 results using search by category but if i click the category link it has (21 posts)

  1. Scott@adszoom
    Member
    Posted 1 year ago #

    Hi

    If you click on the category companies hiring gen. @ http://www.adszoom.com under “ jobs “ there are plenty of results but if you use the “ search by category “ at the top of the home page or any other, If you search the same category companies hiring gen. this way 0 results com up Why is this? Its not just that category its site wide.

    Help please :}

  2. David Gard
    Member
    Posted 1 year ago #

    I'm guessing it's a coding error, but we'd need to see your code for that section of the site. Please go to Pastebin.com and paste the code there, then give us the link so that we can take a look.

  3. Scott@adszoom
    Member
    Posted 1 year ago #

    Hi

    Ya I changed 0 code from default 2011 theme but am using this plug in " search by category " by " Fire G " so i went to the PLUG IN'S site for more info and it was a mess nothing worked there as well so i think im going to find a better " search by cat " plug in and start there. If there are coding issues its there...... Do you have a better plug in for this off the top of your head ? Or should i just wright it my self?

  4. Scott@adszoom
    Member
    Posted 1 year ago #

    I forgot to tell ya its a child of the 2011 theme...

  5. n-for-all
    Member
    Posted 1 year ago #

    remove "Search for..." from the input field and tell me if it works

  6. Scott@adszoom
    Member
    Posted 1 year ago #

    lol ya works like a charm how did you know?

  7. n-for-all
    Member
    Posted 1 year ago #

    :)

    contact the plugin author for him to fix it, if he doesn't i will fix for you

    cheers

  8. Scott@adszoom
    Member
    Posted 1 year ago #

    THANKS! hay quick question.... if i wanted just to show excerpts on these results page how do i change that real quick the problem is i changed to this new theme i built and there was about 12k posts already and the theme shows the full post ( no good ) on pre existing posts.

    Any idea?

  9. n-for-all
    Member
    Posted 1 year ago #

    edit search.php file, there is "the_content()"

    replace with "the_excerpt()"

  10. Scott@adszoom
    Member
    Posted 1 year ago #

    in content.php correct because this edit search.php file, there is "the_content()"

    replace with "the_excerpt()" is not on the search.php in the 3.4.1 ver wp

    <?php else : ?>
    		<div class="entry-content">
    			<?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>

    like this ? works for me but just to conf... how about showing the thumb nail in the excerpt ?

  11. n-for-all
    Member
    Posted 1 year ago #

    you mean showing featured image in the excerpt

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail();
    }
    ?>

    http://codex.wordpress.org/Function_Reference/the_post_thumbnail

  12. Scott@adszoom
    Member
    Posted 1 year ago #

    Hi

    ya i replaced line i think 42 in the content.php because i could not find 'the_content()' in search .php did i miss it? is that ok what i did in that code pice above? and this snippet you just posted will that show the thumb nail in the excerpt on search.php ? this on?

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail();
    }
    ?>

    that go's in functions.php correct how do you call it? on search.php and will it also show the thumbnail if the category template is called?

  13. n-for-all
    Member
    Posted 1 year ago #

    where did you replace the_content with the_excerpt, put the snippet i gave u before or after depends on where u want to show the thumbnail on the search page

  14. Scott@adszoom
    Member
    Posted 1 year ago #

    I replaced it in the line 42 of content.php

  15. Scott@adszoom
    Member
    Posted 1 year ago #

    was that right ? i think it was for the default 2011 the theme im working on is a child of that

  16. n-for-all
    Member
    Posted 1 year ago #

    i have no idea if it is right or wrong, you should see the output

    i need to see the code to be more sure

    i advise you to hire someone on freelance to do this 1hour job

    regards

  17. Scott@adszoom
    Member
    Posted 1 year ago #

    its done works perfect here is the code

    <?php
    /**
     * The default template for displaying content
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    ?>
    
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<?php if ( is_sticky() ) : ?>
    				<hgroup>
    					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    					<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
    				</hgroup>
    			<?php else : ?>
    			<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    			<?php endif; ?>
    
    			<?php if ( 'post' == get_post_type() ) : ?>
    			<div class="entry-meta">
    				<?php twentyeleven_posted_on(); ?>
    			</div><!-- .entry-meta -->
    			<?php endif; ?>
    
    			<?php if ( comments_open() && ! post_password_required() ) : ?>
    			<div class="comments-link">
    				<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
    			</div>
    			<?php endif; ?>
    		</header><!-- .entry-header -->
    
    		<?php if ( is_search() ) : // Only display Excerpts for Search ?>
    		<div class="entry-summary">
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    			<?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>
    
    		<footer class="entry-meta">
    			<?php $show_sep = false; ?>
    			<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    			<?php
    				/* translators: used between list items, there is a space after the comma */
    				$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    				if ( $categories_list ):
    			?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    				$show_sep = true; ?>
    			</span>
    			<?php endif; // End if categories ?>
    			<?php
    				/* translators: used between list items, there is a space after the comma */
    				$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    				if ( $tags_list ):
    				if ( $show_sep ) : ?>
    			<span class="sep"> | </span>
    				<?php endif; // End if $show_sep ?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
    				$show_sep = true; ?>
    			</span>
    			<?php endif; // End if $tags_list ?>
    			<?php endif; // End if 'post' == get_post_type() ?>
    
    			<?php if ( comments_open() ) : ?>
    			<?php if ( $show_sep ) : ?>
    			<span class="sep"> | </span>
    			<?php endif; // End if $show_sep ?>
    			<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
    			<?php endif; // End if comments_open() ?>
    
    			<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
    		</footer><!-- #entry-meta -->
    	</article><!-- #post-<?php the_ID(); ?> -->

    its correct look on line 41 not 42 just change "content" with "excerpt" the goal was to get all existing posts to fall in line with the posts after the change and this worked perfect in the 2011 theme with 3.4.1 wp

  18. Scott@adszoom
    Member
    Posted 1 year ago #

    thanks for your help on the other issue thu did contact the dev but like i said dont know if he or she will respond so i hacked and fixed..

  19. n-for-all
    Member
    Posted 1 year ago #

    it is already using the_excerpt for search page on line 37

    what u made is using the_excerpt for all pages (like category, etc..) on line 41

    if u want to show the post thumbnail, put this code

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail();
    }
    ?>

    on line 36 before <div class="entry-summary">

  20. Scott@adszoom
    Member
    Posted 1 year ago #

    Ha ok cool ya it was not grabbing the existing posts untill i changed the line 41 now it is and if you click it takes you to the correct view i need for single.php anyway i could not find the "the_content()" on search.php so i changed it there. So this code

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail();
    }
    ?>

    where exactly do i place this ? on search.php or content.php? where exactly ? new to wp so i have to ask these crazy simple questions but thanks for your help? just need complete walk threw on this one. If you have time..

  21. n-for-all
    Member
    Posted 1 year ago #

    what is the code at the search.php file?

Topic Closed

This topic has been closed to new replies.

About this Topic