Community Forums › Forums › Archived Forums › General Discussion › Homepage Image Using Mimimum
- This topic has 24 replies, 3 voices, and was last updated 10 years, 8 months ago by Anita.
-
AuthorPosts
-
June 29, 2013 at 2:38 pm #48393johnstrubelMember
Hi -- In addition, I have a questions about the homepage image using the Minimum theme:
I would like the image to link to the story it is referring too. I included "a href=http://www.mywebsite.com" tags around the image but they are not working.
Any feedback would be helpful. Website is http://www.johnstrubel.com
Thanks,
John
June 29, 2013 at 4:11 pm #48413AnitaKeymasterI have moved your discussion to it's own entry as it is unrelated to the previous person's issue. Where did you add the link?
Love coffee, chocolate and my Bella!
July 4, 2013 at 11:30 am #49215JohnParticipantJohn,
Which image or images are you referring to on the homepage?
John
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 4, 2013 at 5:14 pm #49253johnstrubelMemberHi John:
Thanks for getting in touch. I am referring to the large black and white photo above the fold. It's a photo of me holding a baseball.
I would like the image to link to a post instead of being static. As noted in my original post, I included “a href=http://www.mywebsite.com” tags around the image on the functions.php page but they are not working.
Any help would be appreciated.
Thanks,
John
July 4, 2013 at 5:19 pm #49254JohnParticipantIf you can post the relevant block of code from functions.php I think I can help you out.
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 4, 2013 at 7:51 pm #49268JohnParticipantIf, for example, you wanted to link to your About page, this is the code you would use in the minimum_featured_image function:
<div id="featured-image"><a href="/about-me"><img src="'. get_stylesheet_directory_uri() . '/images/sample.jpg" /></a></div>
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 4, 2013 at 9:48 pm #49276johnstrubelMemberJohn:
That's exactly what I have:
/** Add the featured image section */
add_action( 'genesis_after_header', 'minimum_featured_image' );
function minimum_featured_image() {
if ( is_home() ) {
echo '<div id="featured-image"></div>';
}
elseif ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail() ){
echo '<div id="featured-image">';
echo get_the_post_thumbnail($thumbnail->ID, 'header');
echo '</div>';
}
}Any thoughts?
John
July 5, 2013 at 6:33 am #49306JohnParticipantI don't know what to say - I added the link to your HTML using Firebug and it worked. I also tried it on my own site that is also running the Minimum theme, and the image was linked there.
Sounds like there's something interfering with your functions.php file. Are you able to make other changes to functions.php and they take effect?
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 10:20 am #49331johnstrubelMemberHi John:
Yes. I have been able to make other updates to the file, that's what's confusing. Here is the code to the entire file:
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );/** Set Localization (do not remove) */
load_child_theme_textdomain( 'minimum', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'minimum' ) );/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', __( 'Minimum Theme', 'minimum' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/minimum' );/** Load Google fonts */
add_action( 'wp_enqueue_scripts', 'minimum_load_google_fonts' );
function minimum_load_google_fonts() {
wp_enqueue_style(
'google-fonts',
'http://fonts.googleapis.com/css?family=Open+Sans:400,700',
array(),
PARENT_THEME_VERSION
);
}/** Sets Content Width */
$content_width = apply_filters( 'content_width', 740, 740, 1140 );/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'minimum_add_viewport_meta_tag' );
function minimum_add_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}/** Add new image sizes */
add_image_size( 'header', 1600, 9999, TRUE );
add_image_size( 'portfolio', 330, 230, TRUE );/** Add support for custom background */
add_theme_support( 'custom-background' );/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 1140,
'height' => 100
) );/** Remove Site Tag Line **/
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );/** Unregister layout settings */
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );/** Unregister secondary sidebar */
unregister_sidebar( 'sidebar-alt' );/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );/** Add the featured image section */
add_action( 'genesis_after_header', 'minimum_featured_image' );
function minimum_featured_image() {
if ( is_home() ) {
echo '<div id="featured-image"></div>';
}
elseif ( is_singular( array( 'post', 'page' ) ) && has_post_thumbnail() ){
echo '<div id="featured-image">';
echo get_the_post_thumbnail($thumbnail->ID, 'header');
echo '</div>';
}
}/** Add the page title section */
add_action( 'genesis_after_header', 'minimum_page_title' );
function minimum_page_title() {
require_once( get_stylesheet_directory() . '/page-title.php' );
}/** Customize the post info function */
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter( $post_info ) {
if ( !is_page() ) {
$post_info = __( 'Posted on', 'minimum' ) . ' [post_date] // [post_comments] [post_edit]';
return $post_info;
}}/** Customize the post meta function */
add_filter( 'genesis_post_meta', 'post_meta_filter' );
function post_meta_filter( $post_meta ) {
if ( !is_page() ) {
$post_meta = '[post_categories before="' . __( 'Filed Under: ', 'minimum' ) . '"] // [post_tags before="' . __( 'Tagged: ', 'minimum' ) . '"]';
return $post_meta;
}}/** Modify the size of the Gravatar in the author box */
add_filter( 'genesis_author_box_gravatar_size', 'minimum_author_box_gravatar_size' );
function minimum_author_box_gravatar_size( $size ) {
return '96';
}/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );/** Add custom footer if widget area is used */
add_action( 'genesis_footer', 'minimum_custom_footer', 6 );
function minimum_custom_footer() {if ( is_active_sidebar( 'custom-footer' ) ) {
remove_action( 'genesis_footer', 'genesis_do_footer' );
echo '<div class="custom-footer">';
dynamic_sidebar( 'custom-footer' );
echo '</div><!-- end .custom-footer -->';}
}/** Create portfolio custom post type */
add_action( 'init', 'minimum_portfolio_post_type' );
function minimum_portfolio_post_type() {
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio', 'minimum' ),
'singular_name' => __( 'Portfolio', 'minimum' ),
),
'exclude_from_search' => true,
'has_archive' => true,
'hierarchical' => true,
'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png',
'public' => true,
'rewrite' => array( 'slug' => 'portfolio' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
)
);
}/** Change the number of portfolio items to be displayed (props Bill Erickson) */
add_action( 'pre_get_posts', 'minimum_portfolio_items' );
function minimum_portfolio_items( $query ) {if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) {
$query->set( 'posts_per_page', '12' );
}}
/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'home-featured-1',
'name' => __( 'Home Featured #1', 'minimum' ),
'description' => __( 'This is the home featured #1 section.', 'minimum' ),
) );
genesis_register_sidebar( array(
'id' => 'home-featured-2',
'name' => __( 'Home Featured #2', 'minimum' ),
'description' => __( 'This is the home featured #2 section.', 'minimum' ),
) );
genesis_register_sidebar( array(
'id' => 'home-featured-3',
'name' => __( 'Home Featured #3', 'minimum' ),
'description' => __( 'This is the home featured #3 section.', 'minimum' ),
) );
genesis_register_sidebar( array(
'id' => 'home-featured-4',
'name' => __( 'Home Featured #4', 'minimum' ),
'description' => __( 'This is the home featured #4 section.', 'minimum' ),
) );
genesis_register_sidebar( array(
'id' => 'custom-footer',
'name' => __( 'Custom Footer', 'minimum' ),
'description' => __( 'This is the custom footer section.', 'minimum' ),
) );Does anything look out of place to you?
Thanks for all your help!
John
July 5, 2013 at 10:25 am #49332JohnParticipantLet's try something different. Why don't you send me the actual functions.php file using my Filedrop at this address: http://blackhillswebworks.com/client-filedrop/
Then I can check it out using my text editor...
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 10:27 am #49333johnstrubelMemberOK. It's in the dropbox
July 5, 2013 at 10:30 am #49334johnstrubelMemberApologies ... I sent you the Genesis functions.php file first. I've uploaded the child theme functions.php file.
July 5, 2013 at 10:55 am #49342JohnParticipantGot it. So is that the actual functions.php file you're using on your site at this moment? The only change from the default appears to be the link tag on the featured image. I'm wondering if any other edits have an effect on the site?
For example, duplicate the image and call it featured-image.jpg, upload it to the theme's images directory, and edit that line in the code so it uses the new image instead of sample.jpg, then see if it uses the new image on the site.
Another possibility - what are you using for an FTP client? The functions.php file you sent has an extra line added after every other line. I ran into this once with Filezilla, and I think the fix was to go to Settings > Transfers > File Types and make sure it was set to Binary.
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 11:52 am #49364johnstrubelMemberHi John:
Well, I walked through the steps and the file is still displaying as "sample.jpg" with no hyperlink.
I use Ipswitch FTP software. I checked the setting and transfers and, yes, it is set to binary.
John
July 5, 2013 at 12:00 pm #49366JohnParticipantHmm, that is weird. Silly question, are you sure you're uploading to the correct directory on your server?
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 12:32 pm #49371johnstrubelMemberHi John:
Not a silly question at all. Here are the folder locations:
The "functions.php" file is loaded to: /wp-content/themes/minimum
The "featured-image.jpg" file is loaded to: /wp-content/themes/minimum/images
John
July 5, 2013 at 12:49 pm #49373JohnParticipantThat sounds right, but what about above those directories? Any chance you were using a subdomain for a development site? I know from experience that it's possible to upload the right file to the wrong place, or the wrong file to the right place, and then wonder why nothing changed on the site.
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 12:50 pm #49374JohnParticipantOr do you have a cache plugin that needs to be purged or flushed?
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉July 5, 2013 at 12:58 pm #49377johnstrubelMemberHi John:
No cache plugin and, no, I didn't use a subdomain to develop. I loaded the theme -- both Genesis and child theme (Minimum) to the root folder when designing.
No, I even checked Jetpack, which is installed through WordPress, but nothing is active that would interfere.
This is so odd. I've never had this type of error before.
John
July 5, 2013 at 1:15 pm #49381JohnParticipantThis is a mystery. If you want me to look deeper I'd need your FTP details. Otherwise, I'm out of possible answers for the moment.
John Sundberg | blackhillswebworks.com
A WordPress developer’s toolbox: Firebug | WordPress Codex | Google 😉 -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.