['name' => 'Cards', 'singular_name' => 'Card'], 'public' => true, 'has_archive' => false, 'menu_icon' => 'dashicons-images-alt2', 'supports' => ['title', 'thumbnail'], 'taxonomies' => ['category'],] ); } } add_action('init', 'new_post_type'); function mostrar_tabs($atts) { $atts = shortcode_atts(array( 'categorias' => 'todos,humanidades,comunidad,cultura,gobierno', 'entradas' => 3 ), $atts); $entradas = intval($atts['entradas']); // Se convierte la cadena de un texto en un arreglo $categorias_array = explode(',', str_replace(' ', '', $atts['categorias'])); ob_start(); ?>
$cat): ?>
'cards_type', 'posts_per_page' => $entradas, 'post_status' => 'publish' ); if (strtolower($cat) !== 'todos') { $categoria_obj = get_category_by_slug($cat); if ($categoria_obj) { $args['category'] = $categoria_obj->term_id; } else { $args['category'] = -1; } } $posts = get_posts($args); if ($posts) : foreach ($posts as $post) : $id = $post->ID; $titulo = get_the_title($id); $imagen = get_the_post_thumbnail_url($id, 'medium'); $descripcion = get_field('descripcion', $id); $enlace = get_field('enlace', $id); ?>

No hay noticias en esta categoría.

'; endif; ?>