function sh_latest_posts($atts) { $atts = shortcode_atts(array('cat' => 'news', 'label' => __('News', 'initfest')), $atts); $result = '<section class="content"><h3>' . $atts['label'] . ' | <small><a href="' . esc_url(get_term_link($atts['cat'], 'category')) . '">' . __('see all', 'initfest') . '</a></small></h3><div class="grid">'; $news_args = array('category_name' => 'news,news-bg', 'numberposts' => 6, 'lang' => of_get_lang()); $news = new WP_Query($news_args); ob_start(); if ($news->have_posts()) { $i = 0; while ($news->have_posts() && $i++ < 6) { $news->the_post(); ?> <div class="col3"> <h4><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <p class="info"><?php pll_e('От'); ?> <?php the_author(); ?> | <?php pll_e('Публикувано на'); ?> <?php the_date(); ?> </p> <?php the_excerpt(); ?> <a class="button" href="<?php the_permalink(); ?> "><?php pll_e('виж цялата новина'); ?> </a> </div> <?php if ($i == 3) { echo '</div></section><section class="content"><div class="grid">'; } } } $result .= ob_get_contents(); $result .= '</div></section>'; ob_end_clean(); return $result; }
echo get_stylesheet_uri(); ?> " /> <?php wp_head(); ?> </head> <body> <nav> <div class="content cf"> <a href="<?php echo esc_url(home_url('/')); ?> " class="logo"><img src="<?php echo get_template_directory_uri(); ?> /img/logo.png" alt="OpenFest" /></a> <?php wp_nav_menu(array('theme_location' => 'main-menu')); ?> </div> </nav> <?php if (openfest_home_page()) { $blog_details = get_blog_details(); $blog_slug = str_replace('/', '', $blog_details->path); echo '<section class="banner cf"><img src="' . get_template_directory_uri() . '/img/banner-' . of_get_lang() . '-' . $blog_slug . '.png" alt="" /></section>'; }