WordPress.org

Ready to get started?Download WordPress

Forums

Magazine Basic
Search result (4 posts)

  1. alribeiro
    Member
    Posted 7 months ago #

    How do I change the appearance of the search result?
    I want to change the colors of fonts and want to appear a result in each row. Is appearing all along, for example if I ask to search for psychologists the result comes all together and I would each psychologist in a line, is it possible?

  2. Laura Hartwig
    Member
    Posted 7 months ago #

    Yes, it's possible. You would change the appearance through CSS. For making each row appear on another line, that would probably be done in the search.php file. You will probably want to use a child theme if you are making these kinds of changes so your changes don't get overwritten in the next update. If you could give me a link to your site an the code from your search.php file, I might be able to be of more help.

  3. alribeiro
    Member
    Posted 7 months ago #

    Link: http://www.shoppngtijuca.com.br

    <?php
    /**
    * The template for displaying Search Results pages.
    *
    * @since 3.0.0
    */
    get_header(); ?>

    <section id="primary" <?php mb_primary_attr(); ?> role="main">

    <?php if ( have_posts() ) : ?>

    <h1 id="search-header" class="page-title"><?php
    global $wp_query;
    $num = $wp_query->found_posts;
    printf( '%1$s "%2$s"',
    $num . __( ' resultado(s) para', 'magazine-basic'),
    get_search_query()
    );
    ?></h1>

    <?php
    while ( have_posts() ) : the_post();
    global $mb_content_area;
    $mb_content_area = 'main';
    get_template_part( 'content', get_post_format() );
    endwhile;

    mb_pagination();

    else :
    get_template_part( 'content', 'none' );
    endif; // end current_user_can() check
    ?>

    </section><!-- #primary.c8 -->

    <?php get_footer(); ?>

  4. Laura Hartwig
    Member
    Posted 7 months ago #

    Hi,
    This is very hard to do without access to the site itself, and please save a copy of the old file, back up your site and make sure you have ftp access to the site before making any changes to your php files. Sometimes this is a trial and error process. A tiny mistake there can take down your whole site.

    My recommendation would be to change this part:

    <?php
    			while ( have_posts() ) : the_post();
    		    	global $mb_content_area;
    		    	$mb_content_area = 'main';
    		    	get_template_part( 'content', get_post_format() );
    			endwhile;

    to this:

    <?php /* Start the Loop */ ?>
    	<?php while ( have_posts() ) : the_post(); ?>
    		<?php get_template_part( 'content', get_post_format() ); ?>
    	<?php endwhile; ?>
    <?php

    Then keep your fingers crossed :)

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.