space0x42
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Ravenna] Make boxes on header link to other pagesHI all
I used a slightly more complex/complete approach…
I started a child theme, then in child theme functions.php added the following code:function cs_customize_register( $wp_customize ) { for ($pos=1; $pos<=3; $pos++){ $wp_customize->add_setting( 'box_link_'.$pos ); $wp_customize->add_control( 'box_link_'.$pos, array( 'label' => __( 'Box '.$pos.' link', 'ravenna' ), 'section' => 'ravenna_header_boxes', 'type' => 'text', 'priority' => 10 ) ); } } add_action( 'customize_register', 'cs_customize_register' ); function ravenna_header_boxes() { for ($pos=1; $pos<=3; $pos++){ $box_icon = get_theme_mod('box_icon_'.$pos, 'fa-building-o'); $box_link = get_theme_mod('box_link_'.$pos, '#'); echo '<div class="header-block" id="header-block-box-'.$pos.'">'; echo('<a href="'.$box_link.'" target="_self">'); if ($box_icon) { echo '<span class="header-icon"><i class="fa ' . esc_html($box_icon) . '"></i></span>'; } echo '<h3 class="header-title">' . esc_html(get_theme_mod('box_title_'.$pos, 'Solid construction')) . '</h3>'; echo '<div class="header-text">' . wp_kses_post(get_theme_mod('box_text_'.$pos, 'Try it and see for yourself. You will be amazed.')) . '</div>'; echo '</a>'; echo '</div>'; } }
That code adds fields for boxes urls in Customizer and the needed ‘a’ tag around boxes, using the links saved in customizer
Just my 2c ??
Cheers
Same problem here, I tried to publicize to FB this post:
https://gruppo.canovasport.it/piscinemonselice/2015/05/09/inizio-stagione-estiva/
but FB doesn’t publish featured image, but a random one…
I checked opengraph tags in page, and the only og:image present is the propre one:
<meta property="og:image" content="https://gruppo.canovasport.it/piscinemonselice/wp-content/uploads/sites/3/2015/05/monselice_estate_2015.jpg" />
also facebook debug page (https://developers.facebook.com/tools/debug/) detects the right one:
Is there a way to fix this, or at least simply force a fixed image usage?