Title: Code Amp's Replies - page 12 | WordPress.org

---

# Code Amp

  [  ](https://wordpress.org/support/users/codeamp/)

 *   [Profile](https://wordpress.org/support/users/codeamp/)
 *   [Topics Started](https://wordpress.org/support/users/codeamp/topics/)
 *   [Replies Created](https://wordpress.org/support/users/codeamp/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/codeamp/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/codeamp/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/codeamp/engagements/)
 *   [Favorites](https://wordpress.org/support/users/codeamp/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 166 through 180 (of 415 total)

[←](https://wordpress.org/support/users/codeamp/replies/page/11/?output_format=md)
[1](https://wordpress.org/support/users/codeamp/replies/?output_format=md) [2](https://wordpress.org/support/users/codeamp/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codeamp/replies/page/3/?output_format=md)…
[11](https://wordpress.org/support/users/codeamp/replies/page/11/?output_format=md)
12 [13](https://wordpress.org/support/users/codeamp/replies/page/13/?output_format=md)…
[26](https://wordpress.org/support/users/codeamp/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/codeamp/replies/page/27/?output_format=md)
[28](https://wordpress.org/support/users/codeamp/replies/page/28/?output_format=md)
[→](https://wordpress.org/support/users/codeamp/replies/page/13/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Question about plugin capabilities](https://wordpress.org/support/topic/question-about-plugin-capabilities-2/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/question-about-plugin-capabilities-2/#post-15548636)
 * Hey [@emgb_520](https://wordpress.org/support/users/emgb_520/)
 * Essentially we need to create an element that displays the number of results 
   as text / a sentence.
 * So it’s a feature we need to add (that S&F would hook into).
 * There might be a way to get this info to display if you’re happy with a bit of
   PHP coding? I’ll start having a think about this to make sure it is possible…!
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Two Layouts on same page](https://wordpress.org/support/topic/two-layouts-on-same-page-2/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/two-layouts-on-same-page-2/#post-15548616)
 * Hey [@jprichard](https://wordpress.org/support/users/jprichard/) sorry for the
   delay, was caught up in a few things last week.
 * So the outline to get this working would look something like:
 * 1. Assume you are using two different layouts (set to use the same search form)
   
   2. In each layout, make sure to add a custom class in the layout sidebar, we’ll
   use `my-layout-1` and `my-layout-2` as an example. 3. Then we need to override
   the `ajax container` attribute of the search form (the results area), and tell
   it to use (first layout) `.my-layout-1`. We can do that using:
 *     ```
       add_filter( 'search_filter_form_attributes', 'update_ajax_container', 20, 2 );
       function update_ajax_container ( $attributes, $sfid ) {
       	// If the search form ID is not 3784, exit
       	if ( $sfid !== 3784 ) {
       		return $attributes;
       	}
       	// The search form id is 3784 so proceed with modification:
       	$attributes['data-ajax-target'] = '.my-layout-1';
       	return $attributes;
       }
       ```
   
 * I would go ahead and test this, and make sure that after doing the above, only
   the first layout is updated when using ajax.
 * —-
 * Once that is working, then we can head onto linking the second layout – `my-layout-
   2`
 * 4. This is the part that’s totally undocumented (it was also only added in a 
   recent release) – we can tell S&F to update any other area of page in the ajax
   request – so we’re going to set this to to the second layout class with this 
   code:
 *     ```
       $attributes['data-ajax-update-sections'] = wp_json_encode( [
       	'.my-layout-2',
       ] );
       ```
   
 * Adding this to the previous code, in total, it should look like:
 *     ```
       add_filter( 'search_filter_form_attributes', 'update_ajax_container', 20, 2 );
       function update_ajax_container ( $attributes, $sfid ) {
       	// If the search form ID is not 3784, exit
       	if ( $sfid !== 3784 ) {
       		return $attributes;
       	}
       	// The search form id is 3784 so proceed with the modifications:
   
       	// Connect the first layout and set it as the results area
       	$attributes['data-ajax-target'] = '.my-layout-1';
   
       	// Add an additional layout to be updated:
       	$attributes['data-ajax-update-sections'] = wp_json_encode( [
       		'.my-layout-2',
       	] );
   
       	return $attributes;
       }
       ```
   
 * I *think* that will get you on the right path – let me know if it works out for
   you? We might need to run the layout javascript again (something I can explain)
 * And if it does work out, no doubt we’ll need to do a couple of tweaks for pagination
   too… let me know.
 * Thanks
    -  This reply was modified 4 years, 2 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 2 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Custom Layouts - Post + Product grids made easy] Awesome Plugin That Does What the WP Query Block Should Do](https://wordpress.org/support/topic/awesome-plugin-that-does-what-the-wp-query-block-should-do/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/awesome-plugin-that-does-what-the-wp-query-block-should-do/#post-15548497)
 * Thanks for the kind words [@mchelles](https://wordpress.org/support/users/mchelles/)!
 * And good to know you’re implementing using the block editor 🙂
 * ~ Ross
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Custom Layouts - Post + Product grids made easy] Very simple but flexible](https://wordpress.org/support/topic/very-simple-but-flexible/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/very-simple-but-flexible/#post-15528619)
 * Thanks [@markoreklaam](https://wordpress.org/support/users/markoreklaam/) !
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Two Layouts on same page](https://wordpress.org/support/topic/two-layouts-on-same-page-2/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/two-layouts-on-same-page-2/#post-15528235)
 * Hey [@jprichard](https://wordpress.org/support/users/jprichard/)
 * So this might be a bit tricky to implement but not impossible if you’re happy
   to get stuck in with a bit of coding…
 * The issue is that both layouts are assigned to the same search form ID, and S&
   F only looks for the first instance of `.search-filter-results-2965` after an
   ajax reqeuest, and updates both results layouts to use that.
 * If you’re comfortable implementing some hooks in PHP, I can talk you through 
   a way to achieve what you’re after – but its got a few steps involved and uses
   an undocumented features in S&F pro (implementation is changing in v3, that’s
   why its undocumented).
 * If that sounds like what you’re after (?) then I can start collecting the various
   hooks we’ll need, and talk you through them.
 * Thanks
    -  This reply was modified 4 years, 2 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Can not Edit template, or Save new template](https://wordpress.org/support/topic/can-not-edit-template-or-save-new-template/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/can-not-edit-template-or-save-new-template/#post-15523837)
 * As I didn’t hear back from you I’m going to ahead and close this ticket.
 * Feel free to re-open when you have further information.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] CSS style overidden](https://wordpress.org/support/topic/css-style-overidden/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/css-style-overidden/#post-15523834)
 * As I didn’t hear back from you I’m clsoing this ticket for now.
 * Feel free to re-open with further information.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Making whole card clickable](https://wordpress.org/support/topic/making-whole-card-clickable/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/making-whole-card-clickable/#post-15523823)
 * Hey [@fariazz](https://wordpress.org/support/users/fariazz/)
 * At the moment there is no way to do this – I’ll stick on this on the feature 
   requests and see if it’s something we can add a little further down the road.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] 2 custom layouts on the same page with a single search&filter form](https://wordpress.org/support/topic/2-custom-layouts-on-the-same-page-with-a-single-searchfilter-form/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/2-custom-layouts-on-the-same-page-with-a-single-searchfilter-form/#post-15481048)
 * Hey Polinet,
 * With the Divi route, did you try adding the S&F Divi extension?
    [https://searchandfilter.com/documentation/3rd-party/divi/](https://searchandfilter.com/documentation/3rd-party/divi/)
 * > Could you advise if I could use 2 instances of this plugin on the same page
   > with a single search and filter form on the side – with each instance assigned
   > to display its own custom post type but filtered by the same taxonomies from
   > the form? .
 * So you would have 1 search form, and two results areas, which are both affected
   by the same search form? And each results area acts on a different CPT?
 * This might be tricky to setup, but if you can clarify then I’ll be able to advise
   further.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] 2 buttons side by side](https://wordpress.org/support/topic/2-buttons-side-by-side/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/2-buttons-side-by-side/#post-15471644)
 * Hey [@herondino](https://wordpress.org/support/users/herondino/) apologies for
   the delay!
 * I just checked your link and looks like you figured it out with an additional(
   empty) element, and some clever CSS?
 * 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Can not Edit template, or Save new template](https://wordpress.org/support/topic/can-not-edit-template-or-save-new-template/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/can-not-edit-template-or-save-new-template/#post-15449107)
 * Hey [@nitrospectide](https://wordpress.org/support/users/nitrospectide/)
 * I think the best to way to fix this quickly is if you open a ticket on S&F Pro
   support “For attention of Ross” and link this ticket –
    [https://searchandfilter.com/account/support/](https://searchandfilter.com/account/support/)
 * Then we can better take a look at the errors you’re seeing – it sounds like a
   javascript issue intially.
 * Regarding the div, where would you want it? We have hooks for modifying the rendered
   output of layouts, templates, and template elements – so hopefull you should 
   be able to do this:
 * [https://customlayouts.com/documentation/action-filter-reference/](https://customlayouts.com/documentation/action-filter-reference/)
 * There are several `render_output` filters you can use.
 * Thanks
    – Ross
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] CSS style overidden](https://wordpress.org/support/topic/css-style-overidden/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/css-style-overidden/#post-15440753)
 * Heu [@fergumungus](https://wordpress.org/support/users/fergumungus/) – apologies
   I didn’t see this come through.
 * There will always be a way to override the CSS if I can see what you’re working
   with.
 * Regarding the font, I believe that is now set to `inherit` by default so it works
   better with the fonts loaded in different themes.
 * Do you have a link I could look at?
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] manual sort orders to layouts](https://wordpress.org/support/topic/manual-sort-orders-to-layouts/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/manual-sort-orders-to-layouts/#post-15372249)
 * Great news, thanks for letting me know.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Feature Requests](https://wordpress.org/support/topic/feature-requests-216/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/feature-requests-216/#post-15372061)
 * Hey [@cbitner](https://wordpress.org/support/users/cbitner/) – you can achieve
   this kind of functionality via our pro (paid for) search & filter plugin – setup
   instructions are here:
    [https://searchandfilter.com/documentation/search-results/custom-layouts/](https://searchandfilter.com/documentation/search-results/custom-layouts/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] manual sort orders to layouts](https://wordpress.org/support/topic/manual-sort-orders-to-layouts/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/manual-sort-orders-to-layouts/#post-15372057)
 * Hey [@sarju747](https://wordpress.org/support/users/sarju747/)
 * By default it displays only published posts – you might have something else in
   your site affecting our queries (so they include drafts)?
 * Can you try this on a clean / test site and see if you get the same issues?
 * Thanks

Viewing 15 replies - 166 through 180 (of 415 total)

[←](https://wordpress.org/support/users/codeamp/replies/page/11/?output_format=md)
[1](https://wordpress.org/support/users/codeamp/replies/?output_format=md) [2](https://wordpress.org/support/users/codeamp/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codeamp/replies/page/3/?output_format=md)…
[11](https://wordpress.org/support/users/codeamp/replies/page/11/?output_format=md)
12 [13](https://wordpress.org/support/users/codeamp/replies/page/13/?output_format=md)…
[26](https://wordpress.org/support/users/codeamp/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/codeamp/replies/page/27/?output_format=md)
[28](https://wordpress.org/support/users/codeamp/replies/page/28/?output_format=md)
[→](https://wordpress.org/support/users/codeamp/replies/page/13/?output_format=md)