Title: Code Amp's Replies - page 13 | 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 - 181 through 195 (of 415 total)

[←](https://wordpress.org/support/users/codeamp/replies/page/12/?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)…
[12](https://wordpress.org/support/users/codeamp/replies/page/12/?output_format=md)
13 [14](https://wordpress.org/support/users/codeamp/replies/page/14/?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/14/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Order by Custom Field](https://wordpress.org/support/topic/order-by-custom-field-11/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/order-by-custom-field-11/#post-15371223)
 * Hey [@andreasja](https://wordpress.org/support/users/andreasja/)
 * Yeah I think this is the right approach.
 * A WordPress query, if ordered by a custom field will remove any entries that 
   don’t have that custom field associated – which you’ve already discovered and
   worked around by adding this custom field to the “post” post type.
 * That’s the best way around it, but it is a work around, I wish there was a way
   to specific in a query whether or not we wanted to include results which don’t
   have the custom field but as far as I’m aware it’s not possible yet…
 * There was one point I mentioned earlier regarding conditionally loading this 
   query modification.
 * If you are creating a specific page, with your layouts on, then you can simply
   add a check to make sure we are on the right page, before adding your logic:
 *     ```
       function layout_query_args( $query_args, $layout_id ) {
       	// Block editor way would be to check what the current page is
       	/* if ( ! is_page( 'my-page-name' ) ) {
       		return $query_args;
       	} */
   
       	// Because you created layouts in our admin pages, they have an ID so you can test for it here
       	// Change 123 for your own layout ID
       	if ( $layout_id	!== 123 ) {
       		// If the ID doesn't match, get out of here
       		return $query_args;
       	}
   
       	// Now we know the modifications will only apply to a layout with ID - 123
       	// We can add our modifications
       	$query_args[ 'meta_key' ] = 'list_number';
       	$query_args[ 'orderby' ] = 'meta_value_num  date';
       	$query_args[ 'order' ] = 'DESC';
   
       	// Always return in WP filters
       	return $query_args;
       }
   
       add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10, 2 );
       ```
   
 * Here you can see, I’ve added `$layout_id` to the function, and tested against
   layout ID `123` – change this for your layout ID.
 * Also note, the `add_filter(...` line has a `, 2` argument added, which allows
   us to get the `$layout_id` passed into the function.
 * Let me know if that makes sense
 * Best
    – Ross
    -  This reply was modified 4 years, 3 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 3 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 3 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] Insert link on text field (using HTML?)](https://wordpress.org/support/topic/insert-link-on-text-field-using-html/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/insert-link-on-text-field-using-html/#post-15371171)
 * Thanks [@andreasja](https://wordpress.org/support/users/andreasja/)
 * [@herondino](https://wordpress.org/support/users/herondino/) glad you got setup
   🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Group posts by Custom field](https://wordpress.org/support/topic/group-posts-by-custom-field-2/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/group-posts-by-custom-field-2/#post-15336350)
 * Hey [@atoyansk](https://wordpress.org/support/users/atoyansk/)
 * That code looks a little off.
 * Lets try to look at the issue another way (I hope I understood it correctly).
 * Why don’t we create 3 seperate layouts, and for each one, restrict them to a 
   specific country?
 * If that sounds like what you are trying to do, or would work, then I can help
   with the logic to set that up.
 * The other question would be, how are you creating layouts, via the block editor,
   or via our admin pages?
 * Thanks
    -  This reply was modified 4 years, 4 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] 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, 4 months ago](https://wordpress.org/support/topic/manual-sort-orders-to-layouts/#post-15336292)
 * Hey [@sarju747](https://wordpress.org/support/users/sarju747/)
 * Thanks for the kind words!
 * Regarding the manual order – this is a feature provided by wordpress natively.
 * Essentially, any post type, can have a `menu_order` property (but by default,
   this only exists for `pages`).
 * If you were to enable this for other post types (or you are displaying pages,
   in our layouts), then you can use this `manual order` to respect the menu_order
   setting.
 * What post type(s) are you displaying in your layout?
 * Thanks
    – Ross
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Order by Custom Field](https://wordpress.org/support/topic/order-by-custom-field-11/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/order-by-custom-field-11/#post-15336248)
 * Hey [@andreasja](https://wordpress.org/support/users/andreasja/)
 * You would need to use our `custom-layouts/layout/query_args` filter from here:
   
   [https://customlayouts.com/documentation/action-filter-reference/](https://customlayouts.com/documentation/action-filter-reference/)
 * And then add this (modified code) to your child themes `functions.php` file.
 * Try this:
 *     ```
       function layout_query_args( $query_args ) {
       	// Modify the query args
       	$query_args[ 'meta_key' ] = 'your_key';
       	$query_args[ 'orderby' ] = 'meta_value_num';
       	$query_args[ 'order' ] = 'DESC';
   
       	// Always return in WP filters
       	return $query_args;
       }
   
       add_filter( 'custom-layouts/layout/query_args', 'layout_query_args', 10 );
       ```
   
 * You would need to change `your_key` to your custom field key (if you are using
   ACF, let me know, as its not as straight forward as you might think)
 * **Also: just to warn you, this code will apply to all layouts on your site. **
 * What you probably want to do is restrict this to a layout ID or specific page.
 * How are you creating your layouts, as blocks, or via our admin pages?
 * Thanks
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 4 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] CSS style overidden](https://wordpress.org/support/topic/css-style-overidden/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/css-style-overidden/#post-15336160)
 * Hey [@jbonlinea](https://wordpress.org/support/users/jbonlinea/)
 * This is an issue we’re aware of – we need to change some of our css so it can
   be overwritten more easily – planning to address this in an update a few months
   away yet.
 * Do you have a link I could look at so I can provide you with something that would
   work?
 * We probably just need to use the parent classes as part of the selector (to increase
   specificity) and then add your custom class name.
 * Thanks
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Search & Filter] Don’t buy it](https://wordpress.org/support/topic/dont-buy-it-9/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/dont-buy-it-9/#post-15328222)
 * Hey [@wesdavisdev](https://wordpress.org/support/users/wesdavisdev/) – sorry 
   didn’t see this – not patroling the forums here too often.
 * Regarding your question, yeah, all our fields have unique classes so can be targetted
   individually for any custom css – this is the default way to use the pro plugin
   at the moment (with the actual design / WYSIWYG controls coming in version 3,
   for those that don’t want to / can’t code).
 * Thanks
    -  This reply was modified 4 years, 4 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] Woocommerce product currency](https://wordpress.org/support/topic/woocommerce-product-currency/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/woocommerce-product-currency/#post-15309979)
 * Hey Moussa
 * I’m assuming you mean the main currency setting from the WooCommerce settings
   page, eg, a single currency across your whole site?
 * While we won’t be able to hook into that setting directly (until we build a WooCommerce
   price element), you could add the currency symbol next to the price via the before
   + after text panel:
 * [https://drive.google.com/file/d/1V4EGn6zqqefpu5lxZptXzusZhPHedlf3/view?usp=sharing](https://drive.google.com/file/d/1V4EGn6zqqefpu5lxZptXzusZhPHedlf3/view?usp=sharing)
 * You can access the panel once you select the custom field in the editor.
 * Let me know if that all makes sense?
    -  This reply was modified 4 years, 4 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] Restrict Taxonomies Not Working](https://wordpress.org/support/topic/restrict-taxonomies-not-working/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/restrict-taxonomies-not-working/#post-15308029)
 * Hey [@sarju747](https://wordpress.org/support/users/sarju747/) + [@imavexadmin](https://wordpress.org/support/users/imavexadmin/)
 * I have a beta ready with this fix ready to go – [https://customlayouts.com/documentation/beta/](https://customlayouts.com/documentation/beta/)
 * Can you test it and let me know if it solves your issues?
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Restrict Taxonomies Not Working](https://wordpress.org/support/topic/restrict-taxonomies-not-working/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/restrict-taxonomies-not-working/#post-15299684)
 * Hey [@sarju747](https://wordpress.org/support/users/sarju747/) + [@imavexadmin](https://wordpress.org/support/users/imavexadmin/)
 * I can recreate this issue if I select some taxonomy terms and save, and later
   change the post type and try to do something with new taxonomy terms (that belong
   to the next post type).
 * There are a couple of other bugs that need fixing too with WP 5.9 (using gradients
   is throwing an error), tackling them tomorrow, hopefully it won’t take too long
   to complete.
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Restrict Taxonomies Not Working](https://wordpress.org/support/topic/restrict-taxonomies-not-working/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/restrict-taxonomies-not-working/#post-15292652)
 * Thanks for the detailed video!
 * I will do some testing on this tomorrow and let you know what I find.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Restrict Taxonomies Not Working](https://wordpress.org/support/topic/restrict-taxonomies-not-working/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/restrict-taxonomies-not-working/#post-15277490)
 * Hmm sounds odd.
 * Is the taxonomy a custom one? If it is, do you know the “slug” of the taxonomy?
 * + Would you be able to share a screen recording of the save process and show 
   an errors that are there?
 * You can open the browsers “console” to find any error messages – every browser
   has one, and you can follow these steps to open it:
    [https://balsamiq.com/support/faqs/browserconsole/](https://balsamiq.com/support/faqs/browserconsole/)
 * With a screen recording + the console open to see messages, I hope I can see 
   the issue so we can resolve it.
 * Thanks
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).
    -  This reply was modified 4 years, 4 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] Restrict Taxonomies Not Working](https://wordpress.org/support/topic/restrict-taxonomies-not-working/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/restrict-taxonomies-not-working/#post-15271844)
 * Hi [@imavexadmin](https://wordpress.org/support/users/imavexadmin/)
 * Before we continue, let me just make sure I’ve got this right – it sounds like(
   correct me where I’m wrong):
 * – The admin area works, and you can change the restricted taxonomies
    – You can
   save the admin layout, BUT the taxonomies you chose have been cleared when the
   page reloads (after the save) – And, the frontend (the link you provided) does
   not apply the taxonomy restriction?
 * Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Use custom .svg for image placeholder?](https://wordpress.org/support/topic/use-custom-svg-for-image-placeholder/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/use-custom-svg-for-image-placeholder/#post-15271831)
 * Ok thanks for the update – hopefully we’ll get to releasing this feature sooner
   rather than later.
 * Best
    – Ross
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Layouts - Post + Product grids made easy] Use custom .svg for image placeholder?](https://wordpress.org/support/topic/use-custom-svg-for-image-placeholder/)
 *  Plugin Author [Code Amp](https://wordpress.org/support/users/codeamp/)
 * (@codeamp)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/use-custom-svg-for-image-placeholder/#post-15257789)
 * Hey [@ventilator](https://wordpress.org/support/users/ventilator/)
 * Right now there isn’t an easy way to do this – we have a bit of complicated setup
   so we can load SVGs optimally – essentially we register (while a page is loading)
   different SVGs we use via `xlink:href`, and then before the closing body tag 
   we outout those SVGs via PHP – this ensures no SVG is loaded more thank once,
   and keeps the page size down too.
 * If you wanted to hack at it, the easiest thing to do would be to replace the 
   SVG in our plugin, but as you mention that’s generally not advisable.
 * We do plan to an option so you can choose an image from your gallery as the placeholder
   image, but thats not coming for some time.
 * * I do have another idea, we have some PHP hooks, so you can filter the output
   of any of our elements – including the featured image.
 * You could conditionally check for the existance of the image placeholder in the
   content, and replace the html with your own:
    [https://customlayouts.com/documentation/action-filter-reference/](https://customlayouts.com/documentation/action-filter-reference/)
 * You would need one called `custom-layouts/element/render_output`:
 *     ```
       add_filter( 'custom-layouts/element/render_output', 'cl_element_render_output', 10, 2 );
       ```
   
 * I hope that might help until we add this feature!
 * Thanks
    – Ross
    -  This reply was modified 4 years, 4 months ago by [Code Amp](https://wordpress.org/support/users/codeamp/).

Viewing 15 replies - 181 through 195 (of 415 total)

[←](https://wordpress.org/support/users/codeamp/replies/page/12/?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)…
[12](https://wordpress.org/support/users/codeamp/replies/page/12/?output_format=md)
13 [14](https://wordpress.org/support/users/codeamp/replies/page/14/?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/14/?output_format=md)