Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #2055899
Technical question shortcode [gem_news]
Closed

Comments

  • hollandslof started the conversation

    Dear sir/madam,

    Currently we are developing a new website with your theme, that works like a dream. I have a technical question about the shortcode [gem_news] and I'm hoping sincerely that you can help me further.

    Tthe shortcode [gem_news] is using the function thegem_blog to show the posts.

    How can I order this shortcode by a custom field (ACF meta_key)?


    Looking forward to your reply.

    Kind regards.,
    Michiel Vergunst

  •  7,095
    Oliver replied

    Hi Michiel,

    Try to add your post type name in the file:

    /wp-content/plugins/thegem-elements/inc/shortcodes/shortcodes.php

    Line 2100

    'blog_post_types' => $post_types ? explode(',', $post_types) : array('post', 'thegem_news'),
    

    and modify 

    function thegem_vc_get_blog_categories() 

    line 22152 

    you can see example here:

    if(taxonomy_exists('thegem_news_sets')) {
            $terms = get_terms('thegem_news_sets', array('hide_empty' => false));
            foreach ((array)$terms as $term) {
                $categories[$term->name.' ('.__('News', 'thegem').')'] = $term->slug;
            }
        }

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver