-
AuthorSearch Results
-
October 4, 2016 at 11:22 am #61849
In reply to: Media file as hyperlink
TrevorParticipantHi Stan
Q. I want pictures to be displayed as documents (as a hyperlink), no as an image itself. Is this possible?
A. It depends which Display Results method you are using. If you are using As a Shortcode, then editing the results.php template file can probably achieve your goal. If you are using one of the other Display Results methods, then what appears in the results is determined by your theme and its template files. You would have to customize your theme files.Q. Is it possible to have a search form on some specific page, instead of in the sidebar on the right?
A. I assume that your theme allows only standard placement of widgets in that sidebar, yes? This depends on your theme. If you can create a page, and you have some means of placing a text area, you can instead place the form shortcode (shown in the form design on the right) and the theme may well allow it to work. Again, this is theme dependent.September 30, 2016 at 3:58 pm #61291In reply to: Search Results
TrevorParticipantIt turns out this was a combination of searching pages where the results page was in the search (we are trying to prevent this somehow in a future release) and coding errors you made in the results.php file, which I have fixed for you. I am closing this for now.
September 30, 2016 at 3:14 pm #61269In reply to: Search Results
TrevorParticipantFor some reason, the search/results page loads OK to start. The Ajax filter works, but it duplicates the results. First time through it filters, second time it does not. Both times it uses the results.php
A page refresh (not using Ajax) with the search parameters in place gives the right results.
I can’t see any console js errors.
September 29, 2016 at 10:10 am #60954In reply to: Using S&F with Thesis
TrevorParticipantHi Lisa
I am guessing you are located somewhere in the USA and it must be about 4AM there right now?
Using the shortcode (I think the best choice for your theme) it uses our results.php template (from the plugin’s template folder. You can make a copy of that in your theme and then customize it, see here:
I am quite used to making theme-specific versions for users, if they can provide me with a ‘normal’ archives type page in their theme or site that I can use as a reference. Providing that the reference page does not use Isotope or Masonry, which makes it much harder for me to do.
If you are a competent coder, I can show you how using Skype.
September 28, 2016 at 9:10 am #60732In reply to: Getting real time AJAX post count
AnonymousInactiveYeah, but like I said, I’d need that number outside of the template file results.php. What I did to fix this was create another template file (with the ID of the search form) and just loaded the shortcode for that form, while the template file only holds the number of posts which I can then embedd wherever I need it to. Not ideal, but it works. But like I said, it would be useful to get this number inside the form, for example, to display that number inside the form submit button, would that be possible?
September 28, 2016 at 8:18 am #60726In reply to: Archive style result showing – not workin
TrevorParticipantThe documentation shows how to make a copy of the results.php template file here:
But as each theme is different, the actual customizing is not so easy. When I do this, I do not copy and past whole blocks of code, but instead I gradually edit, add, move and delete parts as needed until it becomes to look right.
September 27, 2016 at 8:39 pm #60671In reply to: Archive style result showing – not workin
AnonymousInactiveI`ve been tryin make that thing with the archive page workin but I did not succeeded so I have no other choice but to use the shortcode. Now I am wondering how to impelement that .php code which is how i want my single result to look like :
<?php global $post, $mk_options; if ($view_params['layout'] == 'full') { $image_width = $mk_options['grid_width'] – 40; } else { $image_width = (($mk_options['content_width'] / 100) * $mk_options['grid_width']) – 40; } $post_type = get_post_meta($post->ID, '_single_post_type', true); $post_type = !empty($post_type) ? $post_type : 'image'; ?> <article id="<?php the_ID(); ?>" class="mk-blog-modern-item mk-isotop-item <?php echo $post_type; ?>-post-type"> <?php $media_atts = array( 'image_size' => $view_params['image_size'], 'image_width' => $image_width, 'image_height' => $view_params['grid_image_height'], 'post_type' => $post_type, //'image_quality' => $view_params['image_quality'] ); echo mk_get_shortcode_view('mk_blog', 'components/featured-media', true, $media_atts); if ($view_params['comments_share'] != 'false') { ?> <div class="blog-modern-social-section"> <?php echo mk_get_shortcode_view('mk_blog', 'components/social-share', true); echo mk_get_shortcode_view('mk_blog', 'components/comments', true, ['post_type' => $post_type]); echo mk_get_shortcode_view('mk_blog', 'components/love-this', true); ?> </div> <?php } ?> <div class="mk-blog-meta"> <?php echo mk_get_shortcode_view('mk_blog', 'components/meta', true); echo mk_get_shortcode_view('mk_blog', 'components/title', true); echo mk_get_shortcode_view('mk_blog', 'components/excerpt', true, ['excerpt_length' => $view_params['excerpt_length'], 'full_content' => $view_params['full_content']]); ?> <?php echo do_shortcode( '[mk_button dimension="flat" corner_style="rounded" bg_color="'.$mk_options['skin_color'].'" btn_hover_bg="'.hexDarker($mk_options['skin_color'], 30).'" text_color="light" btn_hover_txt_color="#ffffff" size="medium" target="_self" align="none" url="'.get_permalink().'"]'.__('READ MORE', 'mk_framework').'[/mk_button]' ); ?> <!– "><?php _e('READ MORE', 'mk_framework'); ?> –> <div class="clearboth"></div> </div> <div class="clearboth"></div> </article>
I guess i have to put it in your results.php file… ?
September 24, 2016 at 10:58 am #59828In reply to: Getting real time AJAX post count
TrevorParticipantThe results.php file shows this in the pagination, doesn’t it?
September 23, 2016 at 8:54 am #59685In reply to: Search and filter Custom post types
TrevorParticipantHi Martijn
I am not quite sure what it is you are asking. I am unable to offer you coding advice about how to create theme templates, whether you are writing your own theme or whether you are modifying an existing theme. In our plugin folder you will find a templates folder and in that a results.php file that our plugin uses by default for a form that is set to use the ‘Shortcode’ display results method. Would that help?
Otherwise, do a search of this forum for
have_posts
and see the advice given to others (such as this post) and what others have used.September 22, 2016 at 1:25 pm #59521
RossKeymasterHi Maxime
I figured out the issue – I’ll try to explain..
This page is currently working ok, with visual composer disabled:
http://maximegiraud.fr/fpe/recherche/
Notice the first search result “recherche”, it is a result of the current page, and underneath (
the_excerpt
) there is a blank space…Now when you enable visual composer this page no longer works…
When using a shortcode, the display of results is defined by the template in the S&f folder –
templates/results.php
..Commenting out
the_excerpt
makes this page work again, with S&F and visual composer enabled 🙂So… I tracked down the issue, it seems when visual composer is disabled,
the_excerpt
does not run shortcodes inside, when visual composer is enabled it actually executes shortcodes insidethe_excerpt
…The problem is with the first result – “recherche” – because it is the S&F results page, and if it executes the result shortcode in
the_excerpt
, then you have an endless loop…One way to get around this is to exclude the page with your search results, from the search results… To do this, in S&F, go to the
posts
tab, and where its says “exclude post ids”, simply put in a6
, this mean S&F and visual composer in this instance will have no issues.Best
-
AuthorSearch Results