• Resolved antcw

    (@antcw)


    Hi
    I’m trying out your plugin on wordpress 3.8.1 using a child theme of twenty fourteen. I really like what I’ve seen so far, but I would like to customise your search result templates.

    I’ve added the two files (acps-results.php and acps-results_loop.php) to my child theme (wp-content/themes/<name of my theme>). I’ve also tried in the subdirectory you mention (acps/templates). I haven’t changed the templates – just added some extra text to see if it gets picked up.

    This works in acps-results.php, but not acps-results_loop.php. Is there anything you can suggest? I’m a newbie with wordpress, so sorry if it’s really obvious.

    https://www.ads-software.com/plugins/advanced-custom-post-search/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Creare

    (@shane-welland)

    It sounds like you are doing the right thing and have named the files correctly. The loop itself is what lists the individual posts on the results page so anything you put inside that loop should be repeated through each post. If you able to provide a snippet of code from your loop page I might be able to find the problem ??

    Thread Starter antcw

    (@antcw)

    Thanks, Shane. Yes I do seem to have understood correctly. Here’s what I’ve got at the moment. I added ‘here’ at the end of the h1 heading just to see if anything was happening. It’s picking up the correct search results, but is using the listing from your plugin, not my theme copy. I’ve copied acps-results.php into my theme as well but haven’t changed it.

    <?php
    //New results loop
    $acps_results = new WP_Query( $this->acps_args );
    
    //Standard loop
    if( $acps_results->have_posts() ): ?>
    
    <header class="page-header">
        <h1 class="page-title"><?php _e('Search Results','acps');?>here</h1>
    </header>
    
    <?php while( $acps_results->have_posts() ) : $acps_results->the_post(); 
    
    // Start the Loop.
                    while ( have_posts() ) : the_post(); 
    
                        /*
                         * Include the post format-specific template for the content. If you want to
                         * use this in a child theme, then include a file called called content-___.php
                         * (where ___ is the post format) and that will be used instead.
                         */
                        get_template_part( 'content', 'event-single' );
    
                    endwhile;
    
                    // Previous/next page navigation.
                    twentyfourteen_paging_nav();
    
    	endwhile;
    	else:
    	?>
    
        <header class="page-header">
            <h1 class="page-title"><?php _e( 'Nothing Found', 'acps' ); ?></h1>
        </header>
    
        <div class="page-content">
            <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'acps' ); ?></p>
            <?php get_search_form(); ?>
        </div>
    
    <?php
    endif;
    ?>
    Plugin Author Creare

    (@shane-welland)

    Hmm definitely sounds like its not finding your theme files… Which version of the plugin are you using?

    Thread Starter antcw

    (@antcw)

    I’m using v 1.2.1
    I think I might have sorted it – it certainly now finds my theme, though I don’t know if it will cause problems anywhere else. I changed line 49 of acps.php to:

    'template_path' => trailingslashit(get_stylesheet_directory()),

    it was using get_template_directory, which picks up the parent theme

    Plugin Author Creare

    (@shane-welland)

    Ah right, that’s interesting. You are using a child theme then? I’ll add a quick fix for that one, thanks for the feedback its much appreciated!

    Thread Starter antcw

    (@antcw)

    Sorry I should have made that clearer. Thanks very much for a very useful plugin and glad to have helped.

    Thanks antcw, had the same problem, but thanks to your advice, it is now working. Shane I downloaded it pretty recently so guessing you haven’t made the change yet. Great plugin, thanks for your hard work.

    I ran into same issue, and find sadly that a majority of themes and plugins do not account for stylesheet directory for child themes. It is not fixed in the most recent version on the codex (1.2.1)

    Plugin Author Creare

    (@shane-welland)

    Sorry my awareness on this one has been poor. Appreciate the feedback though and it’s in the unreleased (next) version! Thanks again to all!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Customising templates’ is closed to new replies.