Lego2012
12/13/2016 - 4:25 PM

Template Tags

Template Tags

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

<!-- Home URL -->

trailingslashit( home_url() )

<!-- Title -->

get_the_title()

<!-- Permalink -->

get_permalink()

<!-- Excerpt -->

get_the_excerpt()

<!-- Featured image URL -->

if ( ! has_post_thumbnail() ) {
    return;
}

$image_args = array(
    'size' => 'custom-featured-thumb',
    'format' => 'url'
);

// Get the featured image URL
$image_url = genesis_get_image( $image_args );

esc_url( $image_url );

<!-- Alt text -->

// Get the alt text of featured image
$thumb_id = get_post_thumbnail_id( get_the_ID() );
$alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );

// If no alt text is present for featured image, set it to entry title
if ( '' == $alt ) {
    $alt = the_title_attribute( 'echo=0' );
}

echo $alt;