IF taxonomy archive is hierarchical THEN

Look at the docs (please read the docs) for is_taxonomy_hierarchical(). You need to tell it which taxonomy you’re checking: if ( is_taxonomy_hierarchical( ‘my_taxonomy_name’ ) ) { } If you’re template isn’t specific to a taxonomy, and you need to know which taxonomy you’re viewing, use get_queried_object() to figure it out (you were already told how … Read more

URL rewrites af

Use add_rewrite_rule(). function wpse325663_rewrite_resource_type() { add_rewrite_rule(‘^resources\/(.+)/?’, ‘resources/?type=$matches[1]’, ‘top’); } add_action(‘init’, ‘wpse325663_rewrite_resource_type’); An important note from the codex: Do not forget to flush and regenerate the rewrite rules database after modifying rules. From WordPress Administration Screens, Select Settings -> Permalinks and just click Save Changes without any changes.

how to pass args for archive.php query?

The pre_get_posts hook can be used to modify queries before they’re run. You can use $query->set() to set arguments on the WP_Query object, and $query->is_main_query() in the callback to limit your changes to the main query: add_action( ‘pre_get_posts’, function( $query ) { if ( ! is_admin() && $query->is_main_query() ) { $query->set( ‘posts_per_page’, 12 ); } … Read more

Using post type archive page for taxonomy archive

Have you checked the WordPress Template Hierarchy Diagram To get an idea how wordpress choose the tempalte. I’m not sure but according to the WordPress Template Hierarchy, WordPress will choose default archive.php for custom taxonomy if no special template is specified. That means you cannot not have archive-product.php to use with Custom Taxonomy archive. In … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)