Missing options for get_terms functions

I’m trying to query taxonomies with custom fields values, just like:

But the only option in Pinegrow is the Smart Action - Site Tags & Categories - which doesn’t allow to more advanced queries.

Maybe we could add our own $args into queries to quickly customize it while we don’t have a full UI for it.

Hey @sirojuntle,
I’m running out right now, so I’ll write-up more later, but you can search on meta and taxonomies.
Add a loop, give it a custom name.


Scroll down for Taxonomy
image
or meta
image
If you give me specifics I can help more.
Bob

Hi, RobM! Thanks for replying!

I have made some tests and I think I can’t use that.

It would need some work around because I’m trying to query Categories based in Custom Fields. Then in my loop I expect to work with the Taxonomy object, not the Post object. My current solution is:

$args = array(
  'meta_query' => array(
      array(
         'key'       => 'crb_category_sticky',
         'value'     => 'yes',
         'compare'   => '='
      )
  ),
  'taxonomy'  => 'category',
  );
  $terms = get_terms( $args );

foreach( $terms as $term ) :
   $term->name;
   carbon_get_term_meta( $term->term_id, 'crb_category_subtitle' );
endforeach;

I believe your proposed solution would work perfectly if there is a version with WP_Term_Query (or get_terms) instead of WP_Query.

Any thougths?

Thanks again.

Hey @sirojuntle,
Feeling dense today - I’ve thought about this a little and feel like this should be doable, but the only thing I can come up with right now is to add in a custom PHP block.
Sorry,
Bob

Hello, @RobM, it is ok!

I’m already working with a function and PHP code.

By the way, how to use the PHP block?

I’m stuck in ‘PHP Code’. It says “Right click to insert a PHP Block” but it does nothing!

I’m pasting code into that single text field, it works, but is hard to read.

And I’m having some problems with <scripts> tags, I will do some more research in the forum and in my project and I will open another topic.

Thank you again!

The subtext is a little confusing. Essentially what it means is that if you have a whole block of code, right-click on the page to insert a block of PHP and then edit using one of the code editors (built-in or external).


and then,

and then

Hi, @Robm!

I didn’t expect you to answer on Saturday. Thanks for fast replying.

I don’t have all those options when I right click my html elements.

imagem_2021-01-18_120340

Am I missing some configuration or add-on?

I’m using Wordpress Theme Builder 1.3

Sorry, didn’t realize you were using the theme builder. I don’t think it has a provision for adding in code within the program. I guess you will have to edit the exported PHP files. I guess this is a feature of the full Pinegrow WordPress program. The right-click comment needs to be addressed.
Bob

Hello,

Is there no intention to add the feature in the future? It would be especially helpful to adjust pagination in custom queries in $args blocks.

Other than that, thank you again for the support and I’m liking very much the software, I think I could do all tasks I tried sucessfully!