Forum Replies Created
-
AuthorPosts
-
alistairmckenzie
MemberSorry should have posted I fixed it, thanks anyway
alistairmckenzie
MemberI think I've been overthinking this and I've managed to achieve the result that I wanted.
For other peoples reference I just changed:
function custom_featured_image() { $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'home-news' ), 'attr' => array( 'class' => 'alignnone post-image' ) ) ); printf( '<a href="%s" title="%s">%s </a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
To a much simpler version, this:
function custom_featured_image() { echo '<div class="news-featured-image">'; the_post_thumbnail('home-news'); echo '</div>'; }
The downside is that this way the image doesn't link to the post but I don't require that anymore.
It would be nice if someone could help amend the above to include the 'alt' tag because that is missing?
alistairmckenzie
MemberYes they are being generated in the image directory at the 280px 280px size. I think it is a problem with the function I've used to show the image because this is the output on the page:
<img width="767" height="850" src="http://thewebsiteaddress.co.uk/mytheme/wp-content/uploads/2016/10/theimage.jpg" class="alignnone post-image" alt="" srcset="thewebsiteaddress.co.uk/mytheme/wp-content/uploads/2016/10/theimage.jpg 767w, http://thewebsiteaddress.co.uk/mytheme/wp-content/uploads/2016/10/theimage-271x300.jpg 271w" sizes="(max-width: 767px) 100vw, 767px">
So it appears that this is where it is going wrong and I need to correct the function in my original posts that outputs the image to the page. It obviously isn't using the 'home-news' size.
alistairmckenzie
MemberHi Victor, I've already tried regenerating the thumbnails but that unfortunately didn't work 🙁
alistairmckenzie
MemberThis reply has been marked as private.alistairmckenzie
MemberOK cheers Brad I'll give it a go
alistairmckenzie
MemberThanks brad, but really all I want to do is if some one comes to Site B from SIte A I want to use style1.css instead of style.css or if they come to site B from site C it will use style2.css does that make sense if they come from any other site it will just remain style.css
alistairmckenzie
MemberSpot on thank you Victor
alistairmckenzie
MemberI bagged it off and used shiftnav instead
alistairmckenzie
MemberThis reply has been marked as private.alistairmckenzie
MemberLooks full page to me
alistairmckenzie
MemberMaybe the numbers wrong change from:
Original File:
//* Add markup for front page widgets
function altitude_front_page_widgets() {genesis_widget_area( 'front-page-1', array(
'before' => '<div id="front-page-1" class="front-page-1"><div
class="image-section"><div class="flexible-widgets widget-area' .
altitude_widget_area_class( 'front-page-1' ) . '"><div class="wrap">',
'after' => '</div></div></div></div>',
) );to New
//* Add markup for front page widgets
function altitude_front_page_widgets() {echo '<div id="front-page-1"><div class="wrap">';
genesis_widget_area( 'front-page-1', array( 'before' => '<div
class="front-page-1 widget-area">', ) );
echo '</div></div>';Try the above its only the front page 1 and make sure you dont leave the
trailing ) ); in before the next widget area Alistairalistairmckenzie
MemberHI pairfum i did the following and it worked for me it might not be perfect but it works see below:
I altered the front-page.php line 72 and changed the front-page-1 to the below and then added my slider into the Front Page 1 widget area hope it works for you
//* Add markup for front page widgets
function altitude_front_page_widgets() {echo ‘<div id=”front-page-1″><div class=”wrap”>';
genesis_widget_area( ‘front-page-1′, array( ‘before’ => ‘<div class=”front-page-1 widget-area”>’, ) );
echo ‘</div></div>';alistairmckenzie
MemberOK I sorted it myself and it works for me I altered the front-page.php line 72 and changed the front-page-1 to the below and then added my slider into the Front Page 1 widget area hope it works for you
//* Add markup for front page widgets
function altitude_front_page_widgets() {echo '<div id="front-page-1"><div class="wrap">';
genesis_widget_area( 'front-page-1', array( 'before' => '<div class="front-page-1 widget-area">', ) );
echo '</div></div>';alistairmckenzie
MemberI would like to do the same thing if anybody has the answer
alistairmckenzie
MemberIncase anybody else wants to know fixed it in the CPT as below:
/** Create portfolio custom post type post_type_name */
add_action( 'init', 'create_custom_post_type' );
function create_custom_post_type() {
register_post_type( 'post_type_name',
array(
'labels' => array(
'name' => __( 'post_type_name', 'Theme_name' ),
'singular_name' => __( 'post_type_name', 'Theme_name' ),
),
'has_archive' => true,
'hierarchical' => true,
'public' => true,
'rewrite' => array( 'slug' => 'post_type_name' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'genesis-seo', 'genesis-cpt-archives-settings' ),
)
);
}function add_portfolio_page_title() {
if ( is_post_type_archive( 'post_type_name' ) )
echo '<div class="entry-header-wrapper"><h1>Your Page Title Here</h1><div class="wrap">';
};
add_action('genesis_after_header', 'add_portfolio_page_title');// Add featured image to CPT post_type_name
function feature_image_header() {
if( is_singular('post_type_name') && has_post_thumbnail()) {genesis_image(
array(
'size' => 'single-post',
'attr' => array( 'class' => 'alignleft' )
) );
}
}alistairmckenzie
MemberYour a star worked a treat thanks to Tony Eppright as well
September 29, 2014 at 7:39 am in reply to: woocommerce product image sizes not correct with Beautiful child theme #126146alistairmckenzie
MemberI have the same issue, I haven't got a fix as yet but think it is something to do with the latest version of woocommerce it doesn't seem compatible with Genesis Connect for woo commerce
alistairmckenzie
MemberTried that al it does is remove the primary sidebar altogether which obviously isn't what I want
alistairmckenzie
MemberIts ok I have sorted it
-
AuthorPosts