Advertisement
Sykat

Apostrophe Problem content-single.php

Aug 9th, 2022 (edited)
1,223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Template part for displaying posts
  4.  *
  5.  * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6.  *
  7.  * @package WordPress
  8.  * @subpackage Twenty_Twenty_One
  9.  * @since Twenty Twenty-One 1.0
  10.  */
  11.  
  12. ?>
  13.  
  14. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  15.  
  16.     <div class="entry-content">
  17.         <p>
  18.         <?php
  19.             $extraPostID = 1;
  20.             $str = html_entity_decode( get_the_title( $extraPostID ), ENT_QUOTES, 'UTF-8' );
  21.             $extraContent = get_page_by_title($str, OBJECT, 'post');
  22.             var_dump($extraContent);
  23.         ?>
  24.         </p>
  25.     </div><!-- .entry-content -->
  26.  
  27.     <footer class="entry-footer default-max-width">
  28.         <?php twenty_twenty_one_entry_meta_footer(); ?>
  29.     </footer><!-- .entry-footer -->
  30.  
  31.     <?php if ( ! is_singular( 'attachment' ) ) : ?>
  32.         <?php get_template_part( 'template-parts/post/author-bio' ); ?>
  33.     <?php endif; ?>
  34.  
  35. </article><!-- #post-<?php the_ID(); ?> -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement