meta http-equiv="X-UA-Compatible" BRIGHT IS THE TRUTH WORSHIP HER OR BE NOTHING content="IE=9; IE=8; IE=7; IE=EDGE"/> link rel="profile" href="http://gmpg.org/xfn/11"> link rel="pingback" href="http://www.magicosophy.com/xmlrpc.php">
$( "#activity-personal-li a" ).mouseover(function() { var href = $(this).attr('href'); $(this).prop("href", href+"mentions"); CRITICAL ERROR! Contact your network administrator Advanced Custom Fields - Code to Display Blog Post in a Template Using a Function - Magicosophy

Post a Story

Advanced Custom Fields – Code to Display Blog Post in a Template Using a Function

<div style=”margin-left:50px; padding-left:50px; width:400px;”>

<?php

$post_object = get_field(‘blog1’);

if( $post_object ):

// override $post
$post = $post_object;
setup_postdata( $post );

?>
<div>
<h3><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>

<?php the_post_thumbnail( ‘medium’ ); ?> </h3>

<?php echo wp_trim_words( get_the_content(), 60 );?>

</div>
<?php wp_reset_postdata(); // IMPORTANT – reset the $post object so the rest of the page works correctly ?>
<?php endif; ?>

</div>

0 Comments

Leave a reply

13517 Views
© RolePages / PebbleArt Inc. 2017

Log in with your credentials

or    

Forgot your details?

Create Account

Skip to toolbar