<?php
$terms = get_terms( array(
'taxonomy' => 'category',
'orderby' => 'name',
'hide_empty' => false,
'count' => false,
'hierarchical' => true,
) );
$terms = wp_list_filter( $terms, array('parent'=>0) ); // Если надо вывести только рубрики верхнего уровня
?>
<?php
if( $terms && ! is_wp_error($terms) ){
foreach( $terms as $term ){
echo "<a href='". get_term_link( (int) $term->term_id, 'category' ) ."'>". $term->name ."</a>";
}
}
?>
/* Open Products in New Tab Woocommerce-DevelopingSense */
remove_action( 'woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open', 10 );
// add a hook to my custom function
add_action ( 'woocommerce_before_shop_loop_item', 'ami_function_open_new_tab', 10 );
function ami_function_open_new_tab() {
echo '<a target="_blank" href="' . get_the_permalink() . '" class="woocommerce-LoopProduct-link">';
}
$query = new WP_Query( array( 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'ID', 'post_status' => 'publish', ) );
while ( $query->have_posts() ) {
$query->the_post();
the_title(); // выведем заголовок поста
foreach( get_the_category() as $category ){
echo $category->cat_name ;
}
echo "<br>";
}
# Load WordPress Core
// Assuming we're in a subdir: "~/wp-content/themes/landingpage/js/emailSend"
require_once( '../../../../../wp-load.php' );