Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The site i'm refering to is Safety Warehouse. It is currently running on a Genesis theme, with the front-page.php displaying a grid loop of the custom post type. I want to add an H1 (or at least a header tag) to use before the content. How can I do this?

My Front-page.php

<?php
/**
 * The custom portfolio post type archive template
 */

/** Force full width content layout */
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

/** Remove the breadcrumb navigation */
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

/** Remove the post info function */
remove_action( 'genesis_before_post_title', 'genesis_post_info' );

/** Remove the post content */
remove_action( 'genesis_post_content', 'genesis_do_post_content' );

/** Remove the post image */
remove_action( 'genesis_post_content', 'genesis_do_post_image' );

/** Add the featured image after post title */
add_action( 'genesis_post_title', 'executive_portfolio_grid' );
function executive_portfolio_grid() {
    if ( has_post_thumbnail() ){
        echo '<div class="portfolio-featured-image">';
        echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
        echo get_the_post_thumbnail($thumbnail->ID, 'portfolio' );
        echo '</a>';
        echo '</div>';
    }
}

/** Remove the post meta function */
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );

genesis();
share|improve this question
    
I don't understand why someone would downvote this. I'm asking how to hook something into the home page of my website. I'm a little confused because of the homepage being controlled by front-page.php instead of the usual is_home conditionals I work with. –  Zach Russell May 19 '13 at 4:14
2  
Without the code of your front-page.php this is impossible to answer. –  toscho May 19 '13 at 7:31
    
I added front-page.php –  Zach Russell May 19 '13 at 20:42

1 Answer 1

This template has removed the content.

/** Remove the post content */
remove_action( 'genesis_post_content', 'genesis_do_post_content' );

So, I assume you want this new tag before this:

<div class="entry-content">

I would suggest not using an h1 tag. It violates the SEO on the page. The page title is in an h1 tag.

<div id="title-area"><h1 id="title"><a href="http://safetyhouse.wpengine.com/" title="Safety Warehouse">Safety Warehouse</a></h1></div><!-- end #title-area -->

The post title is an h2 tag.

<h2 class="entry-title"><a href="http://safetyhouse.wpengine.com/portfolio/traffic-cone-store/" title="Traffic Cone Store" rel="bookmark">Traffic Cone Store</a></h2>

Using an h1 tag at this point may confuse search engines.

To add content to the page above each post content use the 'genesis_before_post_content' action:

add_action( 'genesis_before_post_content', 'wpse_99943_before_content_tag' );
function wpse_99943_before_content_tag() {
    echo '<h3>You didn\'t say what you wanted here.</h3>';
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.