How to properly implement a kerning generated code - php

I have a situation trying to implement into the <header>, a logotext using kerning technique, with this simple but very handy tool made by Mr.Andrew (special thanks).
Before the modification, I had this <header> section in header.php:
...
<!-- Start Header -->
<header class="header row no-padding <?php echo $header_style; ?>" data-equal=">.columns" role="banner">
<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
<?php if ($header_style == 'style2') { ?>
<a class="logotext" href="<?php echo esc_url( home_url( '/' ) ); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
rel="home"><?php bloginfo( 'name' ); ?>
</a>
<?php } ?>
</div>
<?php if ($header_style != 'style2') { ?>
<div class="small-7 medium-4 columns logo">
<?php if ($header_style == 'style1') { ?>
<a class="logotext" href="<?php echo esc_url( home_url( '/' ) ); ?>"
title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
rel="home"><?php bloginfo( 'name' ); ?>
</a>
<?php } ?>
</div>
<?php } ?>
<div class="small-5 <?php if ($header_style == 'style2') { echo 'medium-8'; } else { echo 'medium-4';} ?> columns menu-holder">
<?php $full_menu_true = ($menu_mobile_toggle_view == 'style2' && $header_style == 'style2');?>
<?php if ($full_menu_true) { ?>
<nav id="full-menu" role="navigation">
<?php if ($page_menu) { ?>
<?php wp_nav_menu( array( 'menu' => $page_menu, 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else if(has_nav_menu('nav-menu')) { ?>
<?php wp_nav_menu( array( 'theme_location' => 'nav-menu', 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else { ?>
<ul class="full-menu">
<li>Please assign a menu from Appearance -> Menus</li>
</ul>
<?php } ?>
</nav>
<?php } ?>
<?php if ($header_search != 'off') { do_action( 'thb_quick_search' ); } ?>
<?php if ($header_cart != 'off') { do_action( 'thb_quick_cart' ); } ?>
<a href="#" data-target="open-menu" class="mobile-toggle<?php if (!$full_menu_true) { ?> always<?php } ?>">
<div>
<span></span><span></span><span></span>
</div>
</a>
</div>
</header>
<!-- End Header -->
...
using the generated kerning code, I was tried (and please correct me if it's a bad approach for php coding):
...
<!-- Start Header -->
<header class="header row no-padding <?php echo $header_style; ?>" data-equal=">.columns" role="banner">
<div class="row max_width ">
<div class="small-7 medium-4 columns logo<?php if ($header_style == 'style1') { ?> show-for-large-up<?php } ?>">
<?php if ($header_style == 'style2') { ?>
<span class="logotext" style="letter-spacing: -18px;">n</span>
<span class="logotext" style="letter-spacing: -17px;">e</span>
<span class="logotext" style="letter-spacing: -18.5px;">u</span>
<span class="logotext" style="letter-spacing: -13px;">e</span>
<span class="logotext" style="letter-spacing: -23.5px;">g</span>
<span class="logotext" style="letter-spacing: -7px;">r</span>
<span class="logotext" style="letter-spacing: -19px;">i</span>
<span class="logotext">d</span>
<?php } ?>
</div>
</div>
<?php if ($header_style != 'style2') { ?>
<div class="row max_width ">
<div class="small-7 medium-4 columns logo">
<?php if ($header_style == 'style1') { ?>
<span class="logotext" style="letter-spacing: -18px;">n</span>
<span class="logotext" style="letter-spacing: -17px;">e</span>
<span class="logotext" style="letter-spacing: -18.5px;">u</span>
<span class="logotext" style="letter-spacing: -13px;">e</span>
<span class="logotext" style="letter-spacing: -23.5px;">g</span>
<span class="logotext" style="letter-spacing: -7px;">r</span>
<span class="logotext" style="letter-spacing: -19px;">i</span>
<span class="logotext">d</span>
<?php } ?>
</div>
</div>
<?php } ?>
<div class="row max_width ">
<div class="small-5 <?php if ($header_style == 'style2') { echo 'medium-8'; } else { echo 'medium-4';} ?> columns menu-holder">
<?php $full_menu_true = ($menu_mobile_toggle_view == 'style2' && $header_style == 'style2');?>
<?php if ($full_menu_true) { ?>
<nav id="full-menu" role="navigation">
<?php if ($page_menu) { ?>
<?php wp_nav_menu( array( 'menu' => $page_menu, 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else if(has_nav_menu('nav-menu')) { ?>
<?php wp_nav_menu( array( 'theme_location' => 'nav-menu', 'depth' => 2, 'container' => false, 'menu_class' => 'full-menu', 'walker' => new thb_mobileDropdown ) ); ?>
<?php } else { ?>
<ul class="full-menu">
<li>Please assign a menu from Appearance -> Menus</li>
</ul>
<?php } ?>
</nav>
<?php } ?>
<?php if ($header_search != 'off') { do_action( 'thb_quick_search' ); } ?>
<?php if ($header_cart != 'off') { do_action( 'thb_quick_cart' ); } ?>
<a href="#" data-target="open-menu" class="mobile-toggle<?php if (!$full_menu_true) { ?> always<?php } ?>">
<div>
<span></span><span></span><span></span>
</div>
</a>
</div>
</div>
</header>
<!-- End Header -->
...
Now, not so sure why, the result looks as it should in Chrome but in IE11/Firefox the letters are scrambled somehow in vertical position.
Any thoughts?
LE: with all due respect, I have to reconsider the answer validation because the sugestion doesn't help to have a solution properly implemented, It looks ok in Chrome but in IE/Firefox the Kerning values (the main subject of this question) it doesn't have any effect.
Hope you don't mind guys, but I still need an answer to close this question having the right solution for me and other people that will deal with this issue in the future. If I didn't understand right the implementation steps, it will be ok to have an answer more specific with real examples, I'm not lazy, just a pure noob (I already mentioned in my posts).Thanks.

The issue is that your .logo div is constrained to 33% width because it also has the .medium-4 class.
IE and Firefox are actually handling this correctly. For whatever reason, chrome is letting the content exceed the specified width of the container; this has something to do with the display attribute for .logo being set to table.
The solution is to remove the medium-4 (and small-7) classes and either use the correct scaffolding classes or define the width in your CSS.

Related

How to filter list of kitchens by category

The default state of the page is to show "all kitchens list of all categories" (/?cat=0) with a category dropdown generated using wp_dropdown_categories() which allows the user to select other categories.
The desired use case is:
The user selects a category from a dropdown list and create a search query in the search box and seeing only kitchens in that category that contain the search term.
the result displays only the title and it displays it in another page
please how can i filter kitchens in the same page
add_image_size('header-image', 1200, 360, true);
add_action('wp_enqueue_scripts', function () {
wp_dequeue_style('bootstrap4');
wp_dequeue_style('bootstrap-basic4-main');
wp_enqueue_style('webfont-roboto', get_stylesheet_directory_uri() . '/webfont/roboto/stylesheet.css');
wp_enqueue_style('nelga-bootstrap', get_stylesheet_directory_uri() . '/assets/css/bootstrap.css');
wp_enqueue_style('font-lato', get_stylesheet_directory_uri() . '/assets/fonts/stylesheet.css');
wp_enqueue_script('nelga-block-map', get_stylesheet_directory_uri() . '/block/interactive-map/map.js');
}, 11);
add_action('wp_enqueue_scripts', function () {
wp_dequeue_style('wpuf-css');
wp_register_style('wpuf-css', WPUF_ASSET_URI . '/css/frontend-forms.css');
});
/*add_filter( 'allowed_block_types_all', function () {
return [
'core/block',
'core/image',
'core/paragraph',
'core/heading',
'core/list',
'core/shortcode',
'nelga/icon-with-text',
'nelga/interactive-map
];
});
*/
add_action('init', function () {
register_block_type(__DIR__ . '/block/icon-with-text');
register_block_type(__DIR__ . '/block/interactive-map');
});
// Scripts for Ajax Filter Search
function my_ajax_filter_search_scripts()
{
wp_localize_script('my_ajax_filter_search', 'ajax_url', admin_url('admin-ajax.php'));
}
// Shortcode: [my_ajax_filter_search]
function my_ajax_filter_search_shortcode(){
my_ajax_filter_search_scripts(); // Added here
ob_start(); ?>
<div id="my-ajax-filter-search" class="filter">
<div class="container p-0">
<form>
<div class="d-inline-flex mb-2 mb-lg-0">
<div class="position-relative first-input">
<svg class="position-absolute" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
<style type="text/css">
.st0 {
fill: none;
stroke: #3C3C3C;
stroke-width: 2;
stroke-miterlimit: 10;
}
.st1 {
fill: none;
stroke: #3C3C3C;
stroke-width: 2;
stroke-miterlimit: 9.9999;
}
</style>
<g>
<circle class="st0" cx="21" cy="21" r="20" />
<line class="st0" x1="35" y1="35" x2="41" y2="41" />
<rect x="46.3" y="37.1" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -20.9172 50.5006)" class="st1" width="8.5" height="26.9" />
</g>
</svg>
<label class="screen-reader-text" for="s">Search for:</label>
<input value="<?php the_search_query(); ?>" name="s" id="s" class="form-control " placeholder="Diese Kuche such ich ..">
</div>
<?php wp_dropdown_categories( array(
'show_option_all' => 'All Kategorien',
'show_option_none' => '',
'orderby' => 'id',
'order' => 'ASC',
'show_count' => 0,
'hide_empty' => 0,
'child_of' => 0,
'exclude' => '',
'echo' => 1,
'selected' => 0,
'hierarchical' => 0,
'name' => '',
'id' => 'custom-cat-drop',
'class' => 'form-select',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'category',
'hide_if_empty' => false,
'option_none_value' => -1,
'value_field' => 'term_id',
'required' => false,
) ); ?>
</div>
<select class="form-select">
<option selected>Ganzer Ort</option>
<option value="action">Ganzer Ort1</option>
<option value="action">Ganzer Ort2</option>
<option value="action"><?php the_field('state'); ?></option>
</select>
</div>
<div class="d-inline-flex mb-2 mb-lg-0 ml-lg-3">
<input type="submit" id="searchsubmit" class="btn" name="submit" value="Jetzt Kuche finden">
</div>
</form>
</div>
<?php
return ob_get_clean();
}
add_shortcode('my_ajax_filter_search', 'my_ajax_filter_search_shortcode');
add_filter('doing_it_wrong_trigger_error', function () {
return false;
}, 10, 0);
This is my custom plugin
<?php
$args = array(
'post_type' => 'kitchen',
$postID = get_the_ID()
);
$the_query = new WP_Query($args);
?>
<div class="container">
<div class="row card-kitchens-title">
<h3>Top Küchen</h3>
</div>
<div class="row card-kitchens">
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post();
$postID = get_the_ID();
?>
<?php if (get_field('featured', $postID)) : ?>
<div class="col-sm-4">
<a class="card" href=" <?php echo get_permalink(); ?>">
<?php
if (has_post_thumbnail()) {
echo the_post_thumbnail();
}
?>
<?php if (get_field('price', $postID)) : ?>
<p class="price1"> <?php echo the_field('price', $postID); ?></p>
<?php endif; ?>
<div class="card-body">
<h2 class="card-title"><?php the_title(); ?></h2>
<p class="card-text"> <?php the_field('state', $postID); ?></p>
</div>
</a>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
</div>
<div class="container">
<div class="row card-kitchens-title">
<h3>Empfohlene Küchen</h3>
</div>
</div>
<div class="container p-0">
<div class="row second-box">
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post();
$postID = get_the_ID();
?>
<div class="col-sm-3 cards pb-4">
<a class="card" href=" <?php echo get_permalink(); ?>">
<?php
if (has_post_thumbnail()) {
echo the_post_thumbnail();
}
?>
<?php if (get_field('price', $postID)) : ?>
<p class="price"> <?php echo the_field('price', $postID); ?></p>
<?php endif; ?>
<div class="card-body">
<h2 class="card-title"><?php the_title(); ?></h2>
<p class="card-text"> <?php the_field('state', $postID); ?></p>
</div>
</a>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
</div>

search form closes after clicking in form field

Hi dear programming and PHP geniuses,
I'm new to php and effed up a search form on my Wordpress shop page (wich isn't public yet). After searching for the error for days I still have no clue where the error might be. I installed SublimeText + SublimeLinter to find a syntax error, but apparently there is none ...
The search form closes as soon as I try to type something in (as soon as I click in it).
I use the Mr. Tailor Theme: http://themeforest.net/item/mr-tailor-responsive-woocommerce-theme/full_screen_preview/7292110
So, here is the code (it's quite long and I'm not sure if this alone helps, so please let me know if I have to add anything):
<?php global $woocommerce, $mr_tailor_theme_options; ?>
<footer id="site-footer" role="contentinfo">
<div id="own_footer">
<img src="../../image_assets/logo_footer.png" alt="Logo">
<br><br><br>
<p>Folgen Sie uns auf: </p>
<img src="../../image_assets/instagram_footer.png" alt="Logo" >
<img src="../../image_assets/facebook_footer.png" alt="Logo" >
<img src="../../image_assets/pinterest_footer.png" alt="Logo" >
<br><br><br>
</div>
<br><br>
<p id="newsletter_copy">
NEWSLETTER
<br><br>
Sie haben Interesse an unserem Newsletter und möchten regelmäßig über neue Produkte,
Sonderangebote und andere tolle Sachen informiert werden? Dann registrieren Sie sich für unseren
Newsletter.
</p>
<div id="footer_eingabefeld">
<?php if ( is_active_sidebar( 'footer-widget-area' ) ) : ?>
<div class="trigger-footer-widget-area">
<span class="trigger-footer-widget-icon"></span>
</div>
<div class="site-footer-widget-area">
<div class="row">
<?php dynamic_sidebar( 'footer-widget-area' ); ?>
</div><!-- .row -->
</div><!-- .site-footer-widget-area -->
<?php endif; ?>
<div id="footer_links">
<li>Über Fuchs und Feder</li>
<li>Kontakt</li>
<li>FAQ</li>
<li>Impressum</li>
<li>Mein Konto</li>
</div>
<div class="site-footer-copyright-area">
<div class="row">
<div class="medium-4 columns">
<div class="payment_methods">
<?php
if ( (isset($mr_tailor_theme_options['credit_card_icons']['url'])) && (trim($mr_tailor_theme_options['credit_card_icons']['url']) != "" ) ) {
if (is_ssl()) {
$credit_card_icons = str_replace("http://", "https://", $mr_tailor_theme_options['credit_card_icons']['url']);
} else {
$credit_card_icons = $mr_tailor_theme_options['credit_card_icons']['url'];
}
?>
<img src="<?php echo $credit_card_icons; ?>" alt="<?php _e( 'Payment methods', 'mr_tailor' )?>" />
<?php } ?>
</div><!-- .payment_methods -->
</div><!-- .large-4 .columns -->
<div class="medium-8 columns">
<div class="copyright_text">
<?php if ( (isset($mr_tailor_theme_options['footer_copyright_text'])) && (trim($mr_tailor_theme_options['footer_copyright_text']) != "" ) ) { ?>
<?php _e( $mr_tailor_theme_options['footer_copyright_text'], 'mr_tailor' ); ?>
<?php } ?>
</div><!-- .copyright_text -->
</div><!-- .large-8 .columns -->
</div><!-- .row -->
</div><!-- .site-footer-copyright-area -->
</footer>
</div><!-- #page -->
</div><!-- /st-content -->
</div><!-- /st-pusher -->
<nav class="st-menu slide-from-left">
<div class="nano">
<div class="nano-content">
<div id="mobiles-menu-offcanvas" class="offcanvas-left-content">
<nav id="mobile-main-navigation" class="mobile-navigation" role="navigation">
<?php
wp_nav_menu(array(
'theme_location' => 'main-navigation',
'fallback_cb' => false,
'container' => false,
'items_wrap' => '<ul id="%1$s">%3$s</ul>',
));
?>
</nav>
<?php
$theme_locations = get_nav_menu_locations();
if (isset($theme_locations['top-bar-navigation'])) {
$menu_obj = get_term($theme_locations['top-bar-navigation'], 'nav_menu');
}
if ( (isset($menu_obj->count) && ($menu_obj->count > 0)) || (is_user_logged_in()) ) {
?>
<nav id="mobile-top-bar-navigation" class="mobile-navigation" role="navigation">
<?php
wp_nav_menu(array(
'theme_location' => 'top-bar-navigation',
'fallback_cb' => false,
'container' => false,
'items_wrap' => '<ul id="%1$s">%3$s</ul>',
));
?>
<?php if ( is_user_logged_in() ) { ?>
<ul><li><?php _e('Logout', 'mr_tailor'); ?></li></ul>
<?php } ?>
</nav>
<?php } ?>
<div class="language-and-currency-offcanvas hide-for-large-up">
<?php if (function_exists('icl_get_languages')) { ?>
<?php $additional_languages = icl_get_languages('skip_missing=N&orderby=KEY&order=DIR&link_empty_to=str'); ?>
<select class="topbar-language-switcher">
<option><?php echo ICL_LANGUAGE_NAME; ?></option>
<?php
if (count($additional_languages) > 1) {
foreach($additional_languages as $additional_language){
if(!$additional_language['active']) $langs[] = '<option value="'.$additional_language['url'].'">'.$additional_language['native_name'].'</option>';
}
echo join(', ', $langs);
}
?>
</select>
<?php } ?>
<?php if (class_exists('woocommerce_wpml')) { ?>
<?php echo(do_shortcode('[currency_switcher]')); ?>
<?php } ?>
</div>
<div class="mobile-socials">
<div class="site-social-icons">
<ul class="//animated //flipY">
<?php if ( (isset($mr_tailor_theme_options['facebook_link'])) && (trim($mr_tailor_theme_options['facebook_link']) != "" ) ) { ?><li class="site-social-icons-facebook"><a target="_blank" href="<?php echo $mr_tailor_theme_options['facebook_link']; ?>"><i class="fa fa-facebook"></i><span>Facebook</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['twitter_link'])) && (trim($mr_tailor_theme_options['twitter_link']) != "" ) ) { ?><li class="site-social-icons-twitter"><a target="_blank" href="<?php echo $mr_tailor_theme_options['twitter_link']; ?>"><i class="fa fa-twitter"></i><span>Twitter</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['pinterest_link'])) && (trim($mr_tailor_theme_options['pinterest_link']) != "" ) ) { ?><li class="site-social-icons-pinterest"><a target="_blank" href="<?php echo $mr_tailor_theme_options['pinterest_link']; ?>"><i class="fa fa-pinterest"></i><span>Pinterest</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['linkedin_link'])) && (trim($mr_tailor_theme_options['linkedin_link']) != "" ) ) { ?><li class="site-social-icons-linkedin"><a target="_blank" href="<?php echo $mr_tailor_theme_options['linkedin_link']; ?>"><i class="fa fa-linkedin"></i><span>LinkedIn</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['googleplus_link'])) && (trim($mr_tailor_theme_options['googleplus_link']) != "" ) ) { ?><li class="site-social-icons-googleplus"><a target="_blank" href="<?php echo $mr_tailor_theme_options['googleplus_link']; ?>"><i class="fa fa-google-plus"></i><span>Google+</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['rss_link'])) && (trim($mr_tailor_theme_options['rss_link']) != "" ) ) { ?><li class="site-social-icons-rss"><a target="_blank" href="<?php echo $mr_tailor_theme_options['rss_link']; ?>"><i class="fa fa-rss"></i><span>RSS</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['tumblr_link'])) && (trim($mr_tailor_theme_options['tumblr_link']) != "" ) ) { ?><li class="site-social-icons-tumblr"><a target="_blank" href="<?php echo $mr_tailor_theme_options['tumblr_link']; ?>"><i class="fa fa-tumblr"></i><span>Tumblr</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['instagram_link'])) && (trim($mr_tailor_theme_options['instagram_link']) != "" ) ) { ?><li class="site-social-icons-instagram"><a target="_blank" href="<?php echo $mr_tailor_theme_options['instagram_link']; ?>"><i class="fa fa-instagram"></i><span>Instagram</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['youtube_link'])) && (trim($mr_tailor_theme_options['youtube_link']) != "" ) ) { ?><li class="site-social-icons-youtube"><a target="_blank" href="<?php echo $mr_tailor_theme_options['youtube_link']; ?>"><i class="fa fa-youtube-play"></i><span>Youtube</span></a></li><?php } ?>
<?php if ( (isset($mr_tailor_theme_options['vimeo_link'])) && (trim($mr_tailor_theme_options['vimeo_link']) != "" ) ) { ?><li class="site-social-icons-vimeo"><a target="_blank" href="<?php echo $mr_tailor_theme_options['vimeo_link']; ?>"><i class="fa fa-vimeo-square"></i><span>Vimeo</span></a></li><?php } ?>
</ul>
</div>
</div>
</div>
<div id="filters-offcanvas" class="offcanvas-left-content wpb_widgetised_column">
<?php if ( is_active_sidebar( 'catalog-widget-area' ) ) : ?>
<?php dynamic_sidebar( 'catalog-widget-area' ); ?>
<?php endif; ?>
</div>
</div>
</div>
</nav>
<nav class="st-menu slide-from-right">
<div class="nano">
<div class="nano-content">
<div id="minicart-offcanvas" class="offcanvas-right-content"><?php if ( class_exists( 'WC_Widget_Cart' ) ) { the_widget( 'mr_tailor_WC_Widget_Cart' ); } ?></div>
<div id="wishlist-offcanvas" class="offcanvas-right-content"><div class="widget"></div></div>
</div>
</div>
</nav>
</div><!-- /st-container -->
<!-- ******************************************************************** -->
<!-- * Custom Footer JavaScript Code ************************************ -->
<!-- ******************************************************************** -->
<?php if ( (isset($mr_tailor_theme_options['footer_js'])) && ($mr_tailor_theme_options['footer_js'] != "") ) : ?>
<script type="text/javascript">
<?php echo $mr_tailor_theme_options['footer_js']; ?>
</script>
<?php endif; ?>
<?php if ( (isset($mr_tailor_theme_options['sticky_header'])) && (trim($mr_tailor_theme_options['sticky_header']) == "1" ) ) : ?>
<!-- ******************************************************************** -->
<!-- * Sticky Header **************************************************** -->
<!-- ******************************************************************** -->
<div class="site-header-sticky">
<div class="row">
<div class="large-12 columns">
<div class="site-header-sticky-inner">
<div class="site-branding">
<?php
if ( (isset($mr_tailor_theme_options['site_logo']['url'])) && (trim($mr_tailor_theme_options['site_logo']['url']) != "" ) ) {
if (is_ssl()) {
$site_logo = str_replace("http://", "https://", $mr_tailor_theme_options['site_logo']['url']);
} else {
$site_logo = $mr_tailor_theme_options['site_logo']['url'];
}
?>
<img class="site-logo" src="<?php echo $site_logo; ?>" title="<?php bloginfo( 'description' ); ?>" alt="<?php bloginfo( 'name' ); ?>" />
<?php } else { ?>
<div class="site-title"><?php bloginfo( 'name' ); ?></div>
<?php } ?>
</div><!-- .site-branding -->
<?php
if ( (isset($mr_tailor_theme_options['site_logo_retina']['url'])) && (trim($mr_tailor_theme_options['site_logo_retina']['url']) != "" ) ) {
?>
<script>
//<![CDATA[
// Set pixelRatio to 1 if the browser doesn't offer it up.
var pixelRatio = !!window.devicePixelRatio ? window.devicePixelRatio : 1;
logo_image = new Image();
jQuery(window).load(function(){
if (pixelRatio > 1) {
jQuery('.site-logo').each(function() {
var logo_image_width = jQuery(this).width();
var logo_image_height = jQuery(this).height();
jQuery(this).css("width", logo_image_width);
jQuery(this).css("height", logo_image_height);
jQuery(this).attr('src', '<?php echo $mr_tailor_theme_options['site_logo_retina']['url'] ?>');
});
};
});
//]]>
</script>
<?php } ?>
<div id="site-menu">
<nav id="site-navigation" class="main-navigation" role="navigation">
<?php
wp_nav_menu(array(
'theme_location' => 'main-navigation',
'fallback_cb' => false,
'container' => false,
'items_wrap' => '<ul id="%1$s">%3$s</ul>',
));
?>
</nav><!-- #site-navigation -->
<div class="site-tools">
<ul>
<li class="mobile-menu-button"><a><i class="getbowtied-icon-menu"></i></a></li>
<?php if (class_exists('YITH_WCWL')) : ?>
<?php if ( (isset($mr_tailor_theme_options['main_header_wishlist'])) && (trim($mr_tailor_theme_options['main_header_wishlist']) == "1" ) ) : ?>
<li class="wishlist-button"><a><i class="getbowtied-icon-heart"></i></a><span class="wishlist_items_number"><?php echo yith_wcwl_count_products(); ?></span></li>
<?php endif; ?>
<?php endif; ?>
<?php if (class_exists('WooCommerce')) : ?>
<?php if ( (isset($mr_tailor_theme_options['main_header_shopping_bag'])) && (trim($mr_tailor_theme_options['main_header_shopping_bag']) == "1" ) ) : ?>
<?php if ( (isset($mr_tailor_theme_options['catalog_mode'])) && ($mr_tailor_theme_options['catalog_mode'] == 1) ) : ?>
<?php else : ?>
<li class="shopping-bag-button" class="right-off-canvas-toggle"><a><i class="getbowtied-icon-shop"></i></a><span class="shopping_bag_items_number"><?php echo $woocommerce->cart->cart_contents_count; ?></span></li>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ( (isset($mr_tailor_theme_options['main_header_search_bar'])) && (trim($mr_tailor_theme_options['main_header_search_bar']) == "1" ) ) : ?>
<li class="search-button"><a><i class="getbowtied-icon-search"></i></a></li>
<?php endif; ?>
</ul>
</div>
<div class="site-search">
<?php
if (class_exists('WooCommerce')) {
the_widget( 'WC_Widget_Product_Search', 'title=' );
} else {
the_widget( 'WP_Widget_Search', 'title=' );
}
?>
</div><!-- .site-search -->
</div><!-- #site-menu -->
<div class="clearfix"></div>
</div><!--.site-header-sticky-inner-->
</div><!-- .large-12-->
</div><!--.row-->
</div><!-- .site-header-sticky -->
<?php endif; ?>
<!-- ******************************************************************** -->
<!-- * WP Footer() ****************************************************** -->
<!-- ******************************************************************** -->
<div class="login_header">
<a class="go_home" href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a>
</div>
<?php wp_footer(); ?>
</body>
</html>
Weird thing is also, that this code is from the footer.php, but still it apparently influences the search bar....
I know it's kinda like dynamite fishing, but I just ran out of ideas. So thank you all in advance!
You are referencing the event targets id but the event target does not have an id set. If you inspect your code, the search input element has no id set.
scripts.js(143):
$("body").on('click',function(e) {
if($(e.target).attr('class') == 'getbowtied-icon-search'
|| $(e.target).attr('id') == 's') {
return;
} else {
reset_search_toggles()
$('body').unbind('click');
}
});
If you can not add an id to that element for whatever reason you can also search by its name(I do not advise this, id's are much better).
if($(e.target).attr('class') == 'getbowtied-icon-search'
|| $(e.target).attr('id') == 's'
|| $(e.target).attr('name') == 's') {

wordpress: show posts in two columns

I have a theme that shows the latest four posts in one column. I want to convert this to two posts in two columns.
I made two divs next to each other and put the first in descending order and the other in ascending order. Then I set it to show only 2 posts.
But now it shows 2 posts in the left div and all four posts in the right div:
I don't understand why it is doing this. Here is the code:
<section class="container">
<div class="left-half">
<article>
<!-- =========================
SECTION: LATEST NEWS
============================== -->
<?php
$parallax_number_of_posts = get_option('posts_per_page');
$args = array( 'post_type' => 'post', 'posts_per_page' => $parallax_number_of_posts, 'order' => 'ASC','ignore_sticky_posts' => true );
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
$parallax_one_latest_news_title = get_theme_mod('parallax_one_latest_news_title',esc_html__('Latest news','parallax-one'));
if($parallax_number_of_posts > 0) {
?>
<section class="brief timeline" id="latestnews" role="region" aria-label="<?php esc_html_e('Latest blog posts','parallax-one'); ?>">
<div class="section-overlay-layer">
<div align="center" class="container">
<div class="row">
<!-- TIMELINE HEADING / TEXT -->
<?php
if(!empty($parallax_one_latest_news_title)){
echo '<div class="col-md-12 timeline-text text-left"><h2 class="text-left dark-text">'.esc_attr($parallax_one_latest_news_title).'</h2><div class="colored-line-left"></div></div>';
} elseif ( isset( $wp_customize ) ) {
echo '<div class="col-md-12 timeline-text text-left paralax_one_only_customizer"><h2 class="text-left dark-text "></h2><div class="colored-line-left "></div></div>';
}
?>
<div class="parallax-slider-whole-wrap">
<!--<div class="controls-wrap">
<button class="control_next icon icon-arrow-carrot-down"><span class="screen-reader-text"><?php esc_attr_e('Post slider navigation: Down','parallax-one')?></span></button>
<button class="control_prev fade-btn icon icon-arrow-carrot-up"><span class="screen-reader-text"><?php esc_attr_e('Post slider navigation: Up','parallax-one')?></span></button>
</div>-->
<!-- TIMLEINE SCROLLER -->
<div itemscope itemtype="http://schema.org/Blog" id="parallax_slider" class="col-md-6 timeline-section">
<ul class="vertical-timeline" id="timeline-scroll">
<?php
$i_latest_posts= 0;
while ( $the_query->have_posts() ) : $the_query->the_post();
$i_latest_posts++;
if ( !wp_is_mobile() ){
if($i_latest_posts % 2 == 1){
echo '<li>';
}
} else {
echo '<li>';
}
?>
<div itemscope itemprop="blogPosts" itemtype="http://schema.org/BlogPosting" id="post-<?php the_ID(); ?>" class="timeline-box-wrap" title="<?php printf( esc_html__( 'Latest News: %s', 'parallax-one' ), get_the_title() ) ?>">
<div itemscope itemprop="image" class="icon-container white-text">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail('parallax-one-post-thumbnail-latest-news');
else: ?>
<img src="<?php echo parallax_get_file('/images/no-thumbnail-latest-news.jpg'); ?>" width="150" height="150" alt="<?php the_title(); ?>">
<?php
endif;
?>
</a>
</div>
<div class="info">
<header class="entry-header">
<h1 itemprop="headline" class="entry-title"><br><br><br>
<?php the_title(); ?>
</h1>
<!-- .entry-meta -->
</header>
<div itemprop="description" class="entry-content entry-summary">
<?php the_excerpt(); ?>
<?php printf( esc_html__( 'Bekijk de fotos %s', 'textdomain' ), '<span class="screen-reader-text"> '.get_the_title().'</span>' ); ?>
</div>
</div>
</div>
<?php
if ( !wp_is_mobile() ){
if($i_latest_posts % 2 == 0){
echo '</li>';
}
} else {
echo '</li>';
}
endwhile;
wp_reset_postdata();
?>
</ul>
</div>
</div><!-- .parallax-slider-whole-wrap -->
</div>
</div>
</div>
</section>
<?php
}
} ?>
</article>
</div>
<!--rechts-->
<div class="right-half">
<article>
<!-- =========================
SECTION: LATEST NEWS
============================== -->
<?php
$parallax_number_of_posts = get_option('posts_per_page');
$args = array( 'post_type' => 'post', 'posts_per_page' => $parallax_number_of_posts, 'order' => 'DESC','ignore_sticky_posts' => true );
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
$parallax_one_latest_news_title = get_theme_mod('parallax_one_latest_news_title',esc_html__('Latest news','parallax-one'));
if($parallax_number_of_posts > 0) {
?>
<section class="brief timeline" id="latestnews" role="region" aria-label="<?php esc_html_e('Latest blog posts','parallax-one'); ?>">
<div class="section-overlay-layer">
<div align="center" class="container">
<div class="row">
<!-- TIMELINE HEADING / TEXT -->
<br>
<br>
<br>
<div class="parallax-slider-whole-wrap">
<div class="controls-wrap">
<button class="control_next icon icon-arrow-carrot-down"><span class="screen-reader-text"><?php esc_attr_e('Post slider navigation: Down','parallax-one')?></span></button>
<button class="control_prev fade-btn icon icon-arrow-carrot-up"><span class="screen-reader-text"><?php esc_attr_e('Post slider navigation: Up','parallax-one')?></span></button>
</div>
<!-- TIMLEINE SCROLLER -->
<div itemscope itemtype="http://schema.org/Blog" id="parallax_slider" class="col-md-6 timeline-section">
<ul class="vertical-timeline" id="timeline-scroll">
<?php
$i_latest_posts= 0;
while ( $the_query->have_posts() ) : $the_query->the_post();
$i_latest_posts++;
if ( !wp_is_mobile() ){
if($i_latest_posts % 2 == 1){
echo '<li>';
}
} else {
echo '<li>';
}
?>
<div itemscope itemprop="blogPosts" itemtype="http://schema.org/BlogPosting" id="post-<?php the_ID(); ?>" class="timeline-box-wrap" title="<?php printf( esc_html__( 'Latest News: %s', 'parallax-one' ), get_the_title() ) ?>">
<div itemscope itemprop="image" class="icon-container white-text">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail('parallax-one-post-thumbnail-latest-news');
else: ?>
<img src="<?php echo parallax_get_file('/images/no-thumbnail-latest-news.jpg'); ?>" width="150" height="150" alt="<?php the_title(); ?>">
<?php
endif;
?>
</a>
</div>
<div class="info">
<header class="entry-header">
<h1 itemprop="headline" class="entry-title"><br><br><br>
<?php the_title(); ?>
</h1>
<!-- .entry-meta -->
</header>
<div itemprop="description" class="entry-content entry-summary">
<?php the_excerpt(); ?>
<?php printf( esc_html__( 'Bekijk de fotos %s', 'textdomain' ), '<span class="screen-reader-text"> '.get_the_title().'</span>' ); ?>
</div>
</div>
</div>
<?php
if ( !wp_is_mobile() ){
if($i_latest_posts % 2 == 0){
echo '</li>';
}
} else {
echo '</li>';
}
endwhile;
wp_reset_postdata();
?>
</ul>
</div>
</div><!-- .parallax-slider-whole-wrap -->
</div>
</div>
</div>
</section>
<?php
}
} ?>
</article>
</div>
</section>
If I understood correctly what you want to achieve - to divide several posts into two columns, I can not understand exactly how you want to achieve this into code. If you rely on this condition $the_query->current_post % 2 == 1 to filter the posts, then in your code it only filter printing of the li element, but then the cycle continues and show the post itself, ie what you achieve with this code is to place two posts (div.timeline-box-wrap) elements in one li.If you want to use this method of separation, you should change the code a little (I will simplify it, but the main is, that you must stop current loop if your condition pass).
You don't need to query DB two times with the same query - this is performance issue, so you can use the same result and loop over two times.
You can use $the_query->current_post to get current post and filter.
<section class="container">
<div class="left-half">
<article>
<?php
$parallax_number_of_posts = get_option('posts_per_page');
$args = array( 'post_type' => 'product', 'posts_per_page' => $parallax_number_of_posts, 'order' => 'ASC','ignore_sticky_posts' => true );
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
if($parallax_number_of_posts > 0) {
?>
<section class="brief timeline" id="latestnews" role="region" aria-label="<?php esc_html_e('Latest blog posts','parallax-one'); ?>">
<ul class="vertical-timeline" id="timeline-scroll">
<?php while ( $the_query->have_posts() ) : $the_query->the_post();
if($the_query->current_post % 2 == 1)
continue; ?>
<li><?php the_title() ?></li>
<?php endwhile; ?>
</ul>
</section>
<?php
}
} ?>
</article>
</div>
<div class="right-half">
<article>
<?php
$the_query->rewind_posts();
if ( $the_query->have_posts() ) {
if($parallax_number_of_posts > 0) {
?>
<section class="brief timeline" id="latestnews" role="region" aria-label="<?php esc_html_e('Latest blog posts','parallax-one'); ?>">
<ul class="vertical-timeline" id="timeline-scroll">
<?php while ( $the_query->have_posts() ) : $the_query->the_post();
if($the_query->current_post % 2 == 0)
continue; ?>
<li><?php the_title() ?></li>
<?php endwhile; ?>
</ul>
</section>
<?php
}
} ?>
</article>
</div>
</section>
P.S. You can simplify more, if you set 2 variables: $left and $right and use only one loop to set one or other with html, and then print their values.

Page template suddenly not displaying the_content()

I've suddenly had an issue with a site I run.
Yesterday, the Business Page template on my site stopped showing the_content() copy. I updated 4 plugins earlier in the day; Contact Form 7, Yoast SEO, Jetpack and Wordfence Security. I can't 100% link these as the reason for the issue, because I never noticed the missing content. It was reported by a user. However I know the content was displaying 2 days ago, for sure.
Either way, I individually deactivated all my plugins, but the content didn't reappear.
Below is the code for the page template:
<?php
get_header();
// Calculate the best link back
$taxonomy = reset(wp_get_post_terms( get_the_ID(), 'business' ));
$back_link = get_term_link( $taxonomy, 'business' );
?>
<?php $sidebar_class = ''; ?>
<?php if($background_image = ardee('business_header')) { ?>
<div class="business-header" style="background-image: url(<?php echo $background_image; ?>);">
<?php } else { ?>
<?php $sidebar_class .= ' business-sidebar-flush'; ?>
<div class="business-header business-header-missing">
<?php } ?>
<div class="container">
<div class="row">
< Back to Listings
</div>
</div>
</div>
<div class="container">
<div class="row business-wrapper">
<div class="business-main col-sm-7">
<h1 class="business-title"><?php the_title(); ?></h1>
<h5 class="business-subtitle"><?php echo ardee('business_address'); ?></h5>
<div class="business-content copy">
<?php the_content(); ?>
</div>
<?php if($gallery = ardee('business_gallery')) { ?>
<div class="box business-gallery">
<h4 class="box-title">Photos</h4>
<div class="modal-gallery business-gallery row">
<?php foreach($gallery as $image) { ?>
<div class="business-gallery-image col-sm-4">
<img src="<?php echo $image['sizes']['business-thumb']; ?>" class="img-responsive">
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php if($facilities = ardee('facilities')) { ?>
<div class="box business-facilities">
<?php $facilities_title = ( ardee( 'facilities_title' ) ) ? ardee( 'facilities_title' ) : 'Facilities'; ?>
<h4 class="box-title"><?php echo $facilities_title; ?></h4>
<ul class="list-unstyled list-facilities copy">
<?php foreach($facilities as $facility) { ?>
<li><i class="fa fa-check"></i> <?php echo $facility['facility']; ?></li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if( $documents = ardee('document_categories') ) { ?>
<?php foreach(ardee('document_categories') as $category) { ?>
<div class="box business-category">
<h4 class="box-title"><?php echo $category['title']; ?></h4>
<div class="business-files row">
<?php foreach($category['documents'] as $document) { ?>
<div class="business-gallery-image col-sm-4">
<span><?php echo $document['document_title']; ?>
</div>
<?php } ?>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
<div class="business-aside col-sm-5">
<div class="business-sidebar <?php echo $sidebar_class; ?> box">
<?php if ( has_post_thumbnail() ) { ?>
<div class="business-logo-holder">
<?php the_post_thumbnail( 'business-logo', array( 'class' => 'business-logo img-responsive' ) ); ?>
</div>
<?php } ?>
<div class="business-information">
<?php if($meta = ardee('contact_number')) { ?>
<div class="business-details">
<i class="fa fa-phone t-blue"></i>
<strong><?php echo $meta; ?></strong>
</div>
<?php } ?>
<?php if($meta = ardee('business_address')) { ?>
<div class="business-details">
<i class="fa fa-home t-blue"></i>
<strong><?php echo $meta; ?></strong>
</div>
<?php } ?>
<?php if($meta = ardee('contact_email')) { ?>
<div class="business-details">
<i class="fa fa-envelope t-blue"></i>
<strong><?php echo encrypt_email($meta); ?></strong>
</div>
<?php } ?>
<?php if($meta = ardee('business_website')) { ?>
<div class="business-details">
<i class="fa fa-link t-blue"></i>
<strong><?php echo $meta; ?></strong>
</div>
<?php } ?>
<?php if($facebook = ardee('social_accounts', 'facebook_url') || $twitter = ardee('social_accounts', 'twitter_account')) { ?>
<div class="business-details business-social">
<strong>Social Profiles: </strong>
<?php if($facebook = ardee('social_accounts', 'facebook_url')) { ?><i class="fa fa-facebook-official"></i> <?php } ?>
<?php if($twitter = ardee('social_accounts', 'twitter_account')) { ?><i class="fa fa-twitter"></i><?php } ?>
</div>
<?php } ?>
</div>
<?php if($business_email = ardee('contact_email')) { ?>
<div class="business-contact">
<h4>Contact Business</h4>
<?php echo do_shortcode('[contact-form-7 id="4" title="Business Contact Form"]'); ?>
</div>
<?php } ?>
</div>
<?php $open_hours = reset( ardee( 'open_hours' ) ); ?>
<?php if( $open_hours['monday'] || $open_hours['tuesday'] || $open_hours['saturday'] || ardee( 'lunch_hours' ) ) { ?>
<div class="business-opening">
<h4>Opening Hours</h4>
<dl class="business-hours">
<?php if( $open_hours['monday'] || $open_hours['tuesday'] || $open_hours['saturday'] ) { ?>
<?php foreach($open_hours as $opening_day => $opening_hours) { ?>
<?php if($opening_hours) { ?>
<div class="business-timeslot <?php echo business_open_status($opening_day, $opening_hours); ?>">
<span class="pull-right"><?php echo $opening_hours; ?></span>
<?php echo ucwords($opening_day); ?>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if( ardee( 'lunch_hours' ) ) { ?>
<?php foreach(ardee('lunch_hours') as $opening) { ?>
<?php if($opening_hours['time']) { ?>
<div class="business-timeslot t-red">
<span class="pull-right"><?php echo $opening['time']; ?></span>
<?php echo $opening['title']; ?>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
</dl>
</div>
<?php } ?>
</div>
</div>
</div>
<?php get_footer(); ?>
Anyone spot any glaring issues? I should stress that I didn't edit this in any way prior to the issue.
The content appears fine on all other templates, it is only this one that has the issue, but it's a very important page.
You can view one of the affected pages directly here: http://goo.gl/8L0kNU
I think the issue is you used the_content(); without loop and without loop they can't get the content of page. Use below code and write your code in between them and then check.
<?php
while ( have_posts() ) : the_post();
// Write your code here
endwhile;
?>

Apply Element to Filtered ACF value

I'm trying to place an element (corner ribbon) on certain term images in my archive. I'm using Advanced Custom Fields to assign a value to certain terms. The code below however places a ribbon on EVERY term and not just the one's with the "active15" value associated. Can someone help me with what I'm doing wrong?
This LINK shows a sample of what is happening. Aluminum is the only image that should have the ribbon, but for some reason it seems like the filter isn't being applied.
<!-- Green Ribbon for Top 15 Groups Start -->
<?php
if($terms) {
foreach($terms as $lc) {
if( get_field('group_active_in_focus_15', 'focus15groups_'.$lc->term_id) != 'active15' ) continue;
{
?>
<div class="ribbon ribbon-green">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>
<?php } ?>
<?php
}
}
else
{
echo '<div class="ribbon ribbon-blue">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>';
}
?>
<!-- Green Ribbon for Top 15 Groups End -->
CODE TO GET/DISPLAY TERMS FOR PAGE
<div class="row">
<?php
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var('paged');
}elseif( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
}else{
$paged = 1;
}
$per_page = 12;
#fix
$term_args = array(
'hide_empty' => 0,
'exclude' => array(16, 20, 22, 25, 27, 28, 30, 4, 33, 264 ), //* Enter ID's of parent categories to exclude from list
);
$number_of_terms = wp_count_terms( 'focus15groups' , $term_args); // This counts the total number terms in the taxonomy with a function)
$paged_offset = ($paged - 1) * $per_page;
$libargs = array(
'orderby' => 'name',
'order' => 'ASC',
'exclude' => array(16, 20, 22, 25, 27, 28, 30, 4, 33, 264 ), //* Enter ID's of parent categories to exclude from list
'number' => $per_page,
'offset' => $paged_offset,
);
$_libargs = wp_parse_args($term_args, $libargs);
$libcats = get_terms( 'focus15groups', $_libargs);
#fix
$i = 0;
foreach($libcats as $lc){
if( $i % 4 == 0 ) { ?>
<div class="clearfix"></div>
<?php }
$i++; ?>
<div class="col-lg-3">
<?php $termlink = get_term_link( $lc->slug, 'focus15groups' ); ?>
<div class="panel panel-default <?php the_field('group_active_in_focus_15', 'focus15groups_'.$lc->term_id); ?>">
<div class="panel-image">
<!-- Green Ribbon for Top 15 Groups Start -->
<?php
if($terms) {
foreach($terms as $lc) {
if( get_field('group_active_in_focus_15', 'focus15groups_'.$lc->term_id) != 'active15' ) continue;
{
?>
<div class="ribbon ribbon-green">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>
<?php } ?>
<?php
}
}
else
{
echo '<div class="ribbon ribbon-blue">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>';
}
?>
<!-- Green Ribbon for Top 15 Groups End -->
<?php if( get_field('group_active_in_focus_15', 'focus15groups_'.$term->term_id) != 'active15' ) { ?>
<div class="ribbon ribbon-green">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>
<?php } else { ?>
<?php } ?>
<div class="thumbnail">
<div class="caption">
<br/><br/>
<h1><span class="label label-info"><?php echo $lc->count ?></span></h1>
<p> Symbols </p>
<h4> <a class="label label-default" href="<?php echo $termlink; ?>"> View Group</a> </h4>
</div>
<!-- Get Image by Attachment ID Start-->
<?php
$attachment_id = get_field('taximage', 'focus15groups_'.$lc->term_id);
if ($attachment_id) {
$image = wp_get_attachment_image_src($attachment_id, 'industrygroup-img');
if ($image) {
?>
<img class="img-responsive" src="<?php echo $image[0]; ?>" />
<?php
}
}
else { ?>
<img class="img-responsive" src="http://www.runningalpha.com/wp-content/uploads/2014/08/RA-logo-300px-groups.jpg" alt="<?php the_title(); ?>" />
<?php } ?>
</div>
<!-- Get Image by Attachment ID End-->
</div>
<div class="panel-footer text-center"><?php echo $lc->name; ?>
</div>
</div>
</div>
<?php } ?>
</div>
I managed to find a fix using the following. By moving my code to the else statement made it show for the correct terms. Something seems odd about that, but it works right!
<?php if( get_field('group_active_in_focus_15', 'focus15groups_'.$lc->term_id) != 'active15' ) { ?>
<?php } else { ?>
<div class="ribbon ribbon-green">
<div class="banner">
<div class="text">TOP 15</div>
</div>
</div>
<?php } ?>

Categories