HTML5

This topic is: resolved

This topic contains 1 reply, has 1 voice, and was last updated by  Robin 11 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #61199

    Robin
    Participant
    Post count: 42

    I am trying to convert the custom archive.php file to HTML5 and keep image above title

    I changed

    // Add featured image above title on teasers
    add_action('genesis_before_post_title', 'balance_teaser_image');
    function balance_teaser_image() {
    global $loop_counter;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;

    printf( '<p>%s</p>', get_permalink(), genesis_get_image( array( 'format' => 'html', 'size'=> 'Archives' ) ) );

    }

    to this

    // Add featured image above title on teasers
    add_action('genesis_entry_header', 'balance_teaser_image');
    function balance_teaser_image() {
    global $loop_counter;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;

    printf( '<p>%s</p>', get_permalink(), genesis_get_image( array( 'format' => 'html', 'size'=> 'Archives' ) ) );

    }

    but the title is going above the image when I change it.

    Here are before and after screenshots

    http://adventuresomekitchen.com/screenshotbeforehtml5.jpg

    http://adventuresomekitchen.com/screenshotafterhtml5.jpg

    Also, have this code to shorten the title


    // Replace the 16 and the 20 (16 + 4) with the number of max characters you want.
    add_filter( 'genesis_post_title_text', 'child_shorten_post_title' );
    function child_shorten_post_title($title) {

    // Check that we are on the correct page.
    if ( is_archive() && strlen($title) > 25 )

    // … = ellipsis (...)
    $title = genesis_truncate_phrase($title, 200) . ' …';

    return $title;
    }

    and changed post_title to entry_header but that didn’t work.

    Thanks in advance.
    Robin

    http://adventuresomekitchen.com
    #61200

    Robin
    Participant
    Post count: 42
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘HTML5’ is closed to new replies.