Homepage Image Using Mimimum

Community Forums Forums General Discussion Homepage Image Using Mimimum

This topic is: not resolved

This topic contains 24 replies, has 3 voices, and was last updated by  anitac 1 year ago.

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #48393

    johnstrubel
    Participant
    Post count: 16

    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

    • This topic was modified 1 year ago by  anitac.
    • This topic was modified 1 year ago by  anitac.
    • This topic was modified 1 year ago by  anitac.
    • This topic was modified 1 year ago by  anitac.
    #48413

    anitac
    Participant
    Post count: 7027

    I 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?


    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me! | Plus Me!
    When asking for help, please provide a link or screen shot showing your problem!

    #49215

    John
    Participant
    Post count: 155

    John,

    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 ;)

    #49253

    johnstrubel
    Participant
    Post count: 16

    Hi 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

    #49254

    John
    Participant
    Post count: 155

    If 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 ;)

    #49268

    John
    Participant
    Post count: 155

    If, 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 ;)

    • This reply was modified 1 year ago by  John. Reason: code clean-up
    • This reply was modified 1 year ago by  John. Reason: code clean-up
    #49276

    johnstrubel
    Participant
    Post count: 16

    John:

    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

    #49306

    John
    Participant
    Post count: 155

    I 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 ;)

    #49331

    johnstrubel
    Participant
    Post count: 16

    Hi 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

    #49332

    John
    Participant
    Post count: 155

    Let’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 ;)

    #49333

    johnstrubel
    Participant
    Post count: 16

    OK. It’s in the dropbox

    #49334

    johnstrubel
    Participant
    Post count: 16

    Apologies … I sent you the Genesis functions.php file first. I’ve uploaded the child theme functions.php file.

    #49342

    John
    Participant
    Post count: 155

    Got 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 ;)

    #49364

    johnstrubel
    Participant
    Post count: 16

    Hi 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

    #49366

    John
    Participant
    Post count: 155

    Hmm, 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 ;)

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic.