get_terms not returning any custom taxonomies
You have old version function (get_terms($tax, $args);). Try this: get_terms(array(‘hide_empty’=>0,’taxonomy’=>array(‘tagportfolio’)));
You have old version function (get_terms($tax, $args);). Try this: get_terms(array(‘hide_empty’=>0,’taxonomy’=>array(‘tagportfolio’)));
I’ve had this problem in past try using include with locate_template: I don’t exactly remember the reason but this code still works: Example: include(locate_template(YOUR_TEMPLATE_PATH)); Here’s a complete demonstration too, using the same idea, if you need more help. For Admin Panel include simply works in admin panel. You might want to modify your code like: … Read more
Without specifics, in general, the page code that is output is generated by your theme code. So you would need to look into the theme’s template that is used for that page. The template used is determined by the WordPress Theme Heirarchy , details are here: https://developer.wordpress.org/themes/basics/template-hierarchy/ ; take a look at the graphic which … Read more
Solution found: the reason was that the code including those lines were included in plug-in’s main file and were wrapped in the shortcode launch anymore. I had to put things in another file,like for example function load_shortcode( $atts ){ require_once(getPluginPath().(‘my-project.start.php’)); } add_shortcode( ‘my-project’, ‘load_shortcode’ ); and lines had to be in my-project.start.php getPluginPath() is NOT … Read more
Would using your group class work? .row > .wp-group-block__inner-container { } I don’t know how to add a class to the inner container but figured I would propose this alternative, hope it helps !
I think its actually not allowed or discouraged in WP coding standards. Its is basically saying “If true go ahead”. It’s a short form of this: if ( did_action( ‘init’ ) ) { $scripts->add_inline_script( ‘lodash’, ‘window.lodash = _.noConflict();’ ); } You can also think of this as if it’s inside brackets of an if statement … Read more
From the WordPress documentation on child themes (Referencing or Including Other Files): To reference the parent theme directory, you would use get_template_directory() instead. Therefore, in your child theme, you could include your parent template file like this: <?php include get_template_directory() . ‘/template_parts/layouts/profile/profile-modern.php’; ?>
you might be interested in one of my threads. Here: How to Hard Code Custom menu items Thanks!
If you hook onto a later action such as template_redirect, you should be able to check the query vars to determine if your specific post type is being viewed. add_action( ‘template_redirect’, ‘example_callback’ ); function example_callback() { if( is_single() && get_query_var(‘your-posttype’) ) wp_enqueue_script( .. your args .. ); } Or alternatively like this… add_action( ‘template_redirect’, ‘example_callback’ … Read more
Your code only works if you are actually calling wp_get_attachment_link() somewhere in your template. If you’re not calling the function, then the apply_filters() inside the function will never get called, and therefore your code will have nothing into which to hook.