← Back
Editing: single-sredstva.php
<?php /** * Template part for displaying posts * * @link https://codex.wordpress.org/Template_Hierarchy * * @package WP_Bootstrap_Starter */ /*$query = get_post(get_the_ID()); echo htmlspecialchars_decode($query->post_content);*/ get_header(); ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/inc/assets/css/produkt_style.css?v=<?=time()?>" type="text/css" media="screen" /> <?php while ( have_posts() ) : the_post(); ?> <!-- Start breadcumb Area --> <?php add_image_size( 'about-img-size', 500); //posts add_image_size( 'about-img-size-2', 800); // single post $about_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'about-img-size'); ?> <style> ul { color: black; list-style-type: disc; padding-inline-start: 2rem!important; } #blog-single .post-thumbnail { float: left; margin-right: 50px; margin-bottom: 30px; margin-left: -12px } .news-content { border: unset; border-radius: unset; } .col-12 { border: 1px solid #ddd; border-radius: 15px; } .news-content table { width: unset; } </style> <!--Blog Area Start--> <?php if ( is_single() ) : ?> <div class="container-fluid" style="padding: unset"> <div class="bv-product-title bv_product_sredstva"> <h1><?= get_the_title()?></h1> <div class="breadcumb"><?= yoast_breadcrumb() ?></div> </div> </div> <div id="blog-single" class="container"><div class="row mt-4"> <div class="col-12"> <!-- .entry-header --> <div class="news-content"> <?php $query = get_post(get_the_ID()); echo htmlspecialchars_decode($query->post_content); ?> </div></div><!-- .entry-content --> </div></div> <?php else: ?> <!-- Start single blog --> <div id="news-archive" class="col-lg-4 card"> <a href="<?= get_permalink()?>"> <div class="img-d"> <img src="<?= $about_image[0]?>" alt=""> </div> <div class="card-text"> <div><h4><?= the_title() ?></h4></div> <?php $content = str_replace('<br>', '', htmlspecialchars_decode(get_post()->post_content)); $content = mb_strimwidth(strip_tags($content), 0, 220, '...'); ?> <p><?= $content?></p> </div> </a> </div> <?php endif; ?> <!-- End single blog --> <?php wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'wp-bootstrap-starter' ), 'after' => '</div>', ) ); endwhile; // End of the loop. ?> <?php get_footer();
Save File
Cancel