← Back
Editing: content.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);*/ ?> <!-- 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; } i.fa { color: #ffaa0d; font-size: 20px; margin: 7px; } </style> <!--Blog Area Start--> <?php if ( is_single() ) : ?> <div class="container-fluid" style="padding: unset"> <div class="nav asda-nav"> <h1><?= get_the_title()?></h1> </div> </div> <div id="blog-single" class="container"><div class="row mt-4"> <div class="col-lg-4"><div class="post-thumbnail"> <?php the_post_thumbnail('about-img-size-2'); ?> </div></div> <div class="col-lg-8"> <!-- .entry-header --> <div class="news-content"> <?php the_content(); ?> </div></div><!-- .entry-content --> </div></div> <?php else: ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/inc/assets/css/produkt_style.css?v=<?=time()?>" type="text/css" media="screen" /> <!-- 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>', ) ); ?> <?php ?>
Save File
Cancel