PHP remove a condition in a foreach - php
I'm trying to edit a WordPress plugin which sorts the streams from the platform.
I just want to show any stream from the ID.
This is the link to the page controller (bootstrap)
<?php
$streamHeading = get_option('pixiehuge-stream-heading', 'Our streams');
$streamsection = get_option('pixiehuge-stream-section-enable');
$streams = pixiehuge_streams();
global $sectionNum;
?>
<?php if($streamsection && !empty($streams)): ?>
<section id="streams"<?php echo (!empty($sectionNum) && $sectionNum == 1) ? ' class="firstWithBg"' : '' ?>>
<?php
$sList = [
'twitch' => pixiehuge_streams(false, 'twitch'),
'youtube' => pixiehuge_streams(false, 'youtube'),
'mixer' => pixiehuge_streams(false, 'mixer'),
];
$active = false;
?>
<div class="container">
<div class="section-header">
<article class="topbar">
<h3>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="7px" height="8px"><path fill-rule="evenodd" fill="rgb(57, 191, 253)" d="M-0.000,0.435 C-0.000,0.805 -0.000,7.292 -0.000,7.546 C-0.000,7.877 0.338,8.123 0.672,7.930 C0.940,7.775 6.293,4.649 6.750,4.381 C7.050,4.205 7.045,3.786 6.750,3.611 C6.421,3.415 1.048,0.272 0.658,0.054 C0.373,-0.106 -0.000,0.071 -0.000,0.435 Z"></path></svg>
<?php echo esc_attr($streamHeading); ?>
</h3>
</article>
<!-- /TOP-BAR -->
<article class="bottombar">
<ul>
<?php foreach($sList as $id => $items): ?>
<?php if(!empty($items)):?>
<li<?php echo !$active ? ' class="active"' : '' ?>>
<?php echo esc_attr($id) ?>
</li>
<?php
if(!$active) {
$active = $id;
}
endif; // If not empty ?>
<?php endforeach; // Get categories ?>
</ul>
</article>
<!-- /BOTTOM-BAR -->
</div>
<!-- /SECTION-HEADER -->
<div class="tab-content content">
<?php foreach($sList as $id => $items): ?>
<?php if(!empty($items)): $i = 1; ?>
<div id="<?php echo esc_attr($id) ?>" class="list<?php echo ($active == $id) ? ' active' : '' ?>">
<?php foreach($items as $item): ?>
<?php if($i == 1): ?>
<div class="left">
<article class="streamBox large" style="background-image: url('<?php echo esc_url($item['thumbnail']) ?>');">
<a href="<?php echo esc_url(get_home_url(null, 'stream/' . $item['slug'])) ?>" class="playBtn">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10px" height="12px"><path fill-rule="evenodd" fill="rgb(255, 255, 255)" d="M10.000,6.000 C10.000,6.412 9.789,6.773 9.473,6.968 L9.474,6.968 L1.629,11.835 C1.626,11.837 1.623,11.839 1.620,11.841 L1.616,11.843 L1.616,11.843 C1.457,11.942 1.270,12.000 1.071,12.000 C0.480,12.000 -0.000,11.496 -0.000,10.875 L-0.000,10.875 L-0.000,1.124 L-0.000,1.124 C-0.000,0.503 0.480,-0.000 1.071,-0.000 C1.270,-0.000 1.457,0.057 1.616,0.156 L1.616,0.156 L1.620,0.159 C1.623,0.160 1.626,0.162 1.629,0.164 L9.474,5.031 L9.473,5.031 C9.789,5.227 10.000,5.587 10.000,6.000 Z"></path></svg>
</a>
<div class="details">
<span class="stream <?php echo esc_attr($id) ?>"><?php echo esc_attr($id) ?></span>
<?php echo esc_attr($item['title']) ?>
<h6><?php echo esc_attr($item['author']) ?></h6>
</div>
</article>
</div>
<!-- /LEFT -->
<?php else: // Large thumbnail ?>
<?php if($i == 2): ?>
<div class="right">
<?php endif; ?>
<?php if($i == 4): ?>
<div class="small">
<?php endif; ?>
<article class="streamBox" style="background-image: url('<?php echo esc_url($item['thumbnail']) ?>');">
<div class="details on-hover">
<?php echo esc_attr($item['title']) ?>
<a href="<?php echo esc_url(get_home_url(null, 'stream/' . $item['slug'])) ?>" class="cta-btn">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9px" height="8px"><path fill-rule="evenodd" fill="rgb(255, 255, 255)" d="M4.688,0.182 C4.437,0.442 4.437,0.865 4.688,1.126 L6.805,3.326 L0.643,3.326 C0.288,3.326 -0.000,3.625 -0.000,3.993 C-0.000,4.362 0.288,4.661 0.643,4.661 L6.805,4.661 L4.688,6.861 C4.437,7.122 4.437,7.544 4.688,7.805 C4.939,8.066 5.346,8.066 5.597,7.805 L8.811,4.466 C8.928,4.345 9.000,4.178 9.000,3.993 C9.000,3.809 8.928,3.642 8.811,3.521 L5.597,0.182 C5.346,-0.079 4.939,-0.079 4.688,0.182 Z"></path>
</svg>
</a>
</div>
</article>
<?php if($i == count($items) || $i == 3): ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php $i++; endforeach; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<!-- /CONTENT -->
</div>
<!-- /CONTAINER -->
</section>
<?php endif; ?>
I don't like PHP Object so I'm quite lost. I know I have to remove $sList Lines 12 > 16 since I don't want to sort it from Youtube...
But then I don't know how to edit the foreach line 51 foreach($sList as $id => $items) to do a foreach elements ID with no conditions anymore. Just a foreach of any elements in the TABLE.
I tried to do that from scratch:
line 51
<div class="tab-content content">
<?php foreach($stream as $streams){ ?>
<p><?php echo $stream['title']; ?></p>
<?php } ?>
</div>
But it didn't work... And I can't tell you the error
EDIT
This is working but I can't order it by ID DESC and limit it to 4 results...
<div class="tab-content content">
<?php foreach($streams as $key => $stream): ?>
<p><?php echo $stream['title']; ?></p>
<?php endforeach; ?>
</div>
Thank you for your help
This is working "fine"
<div class="tab-content content">
<?php foreach($streams as $key => $stream): ?>
<p><?php echo $stream['title']; ?></p>
<?php endforeach; ?>
</div>
Related
Magento - related product color swatches
I'm working with Magento EE v1.14 and i'm looking for a solution for when a user is viewing a product page to then drop swatches of related product colors if they are out of stock. Screenshot: Highlighted out of stock related product color Screenshot of HTML PHP + HTML code: <?php $_base_product = $this->getProduct(); $base_product = Mage::getModel('catalog/product')->load($_base_product->getId()); $base_product_id = $base_product->getId(); $base_name = $base_product->getName(); $base_url = Mage::getBaseUrl(); $product_colors = Mage::getModel('catalog/product')->getCollection(); $product_colors->addAttributeToFilter('status',1); // 1 or 2 $product_colors->addAttributeToFilter('visibility',4); // 1.2.3.4 $product_colors->addAttributeToFilter('name', array('eq' => $base_name)); $product_colors->addAttributeToFilter('sku', array('neq' => $base_product->getSku())); $product_colors_ids = $product_colors->getAllIds(); // get all products from the category sort($product_colors_ids); ?> <?php if(count($product_colors_ids) > 0) : ?> <div id="product-color-options-wrapper"> <div id="product-color-options-container"> <label><?php echo $this->__('Color') ?> / <span style="font-weight: normal;"><?php echo $base_product->getAttributeText('color'); ?></span></label> <div id="color-options-wrapper"> <?php $_swatch_img = $base_product->getMediaGalleryImages(false)->getItemByColumnValue('label', 'swatch') ?> <?php if($_swatch_img) : ?> <div class="current-product-wash-wrapper wash-wrapper"> <div class="current-product-wash-container wash-container"> <img src="<?php echo $this->helper('catalog/image')->init($base_product, 'small_image', $_swatch_img->getFile())->resize(33,30) ?>" alt="" title="<?php echo $base_product->getAttributeText('color') ?>" /> </div> </div> <?php else : ?> <!-- <span><?php echo $base_product->getColor() ?></span> --> <?php endif ?> <?php foreach($product_colors_ids as $prod_id) : ?> <?php $_sister_product = Mage::getModel('catalog/product')->load($prod_id) ?> <?php $_sister_prod_imgs = $_sister_product->getMediaGallery('images'); foreach($_sister_prod_imgs as $_sister_prod_img): if($_sister_prod_img['label'] == 'swatch'): $_swatch_img = $_sister_prod_img['file']; endif; endforeach; ?> <?php if($_swatch_img): ?> <div class="sister-product-wrapper wash-wrapper"> <div class="sister-product-container wash-container"> <a href="<?php echo $base_url ?><?php echo $_sister_product->getUrlKey() ?>"> <img src="<?php echo $this->helper('catalog/image')->init($_sister_product, 'small_image', $_swatch_img)->resize(33,30); ?>" alt="" title="<?php echo $_sister_product->getAttributeText('color') ?>"> </a> </div> </div> <?php endif; ?> <?php endforeach ?> <div class="clear"></div> </div> </div> </div> <?php endif ?> Any help would be appreciated! :D
**Solution:**Added an if statement to check for stock availability using the isAvailable() function, shown in screenshot. Link to screenshot: https://gyazo.com/abf07ba0373877836571858ee129cc22
Create outer div if counter is divisible by 4
I have a problem looping my html tags. My goal is to enclose every 4 div with class "item" inside the class of "item-wrap". So far here's my code: $speakers will return 8 rows so "item-wrap" class will be display twice with 4 "item" class inside <?php $speaker_ctr = 0; if(count($speakers) > 0){ ?> <div class="item-wrap"> <?php foreach($speakers as $speaker){ ?> <div class="item"> <img class="lazy" data-lazy-src="<?php echo $speaker['imagepath']; ?>" /> <h5 class="txt-18 bold-font text-uppercase no-mbt mt-20"><?php echo $speaker['name']; ?></h3> <p class="no-mn"><?php echo $speaker['position']; ?></p> <?php echo $speaker['company']; ?> </div> <?php } ?> </div> <?php $speaker_ctr++; } ?>
Try below code:- <?php if(count($speakers) > 0){ for($i=0;$i<=count($speakers);$i++){ if($i%4==0){ echo '<div class="item-wrap">'; } ?> <div class="item"> <img class="lazy" data-lazy-src="<?php echo $speakers[$i]['imagepath']; ?>" /> <h5 class="txt-18 bold-font text-uppercase no-mbt mt-20"><?php echo $speakers[$i]['name']; ?></h3> <p class="no-mn"><?php echo $speakers[$i]['position']; ?></p> <?php echo $speakers[$i]['company']; ?> </div> <?php if($i%4==0){ echo '</div>'; } } }
Try with - $speaker_ctr = 0; if(count($speakers) > 0){ ?> <div class="item-wrap"> <?php foreach($speakers as $speaker){ $speaker_ctr++; // increment ?> <div class="item"> <img class="lazy" data-lazy-src="<?php echo $speaker['imagepath']; ?>" /> <h5 class="txt-18 bold-font text-uppercase no-mbt mt-20"><?php echo $speaker['name']; ?></h3> <p class="no-mn"><?php echo $speaker['position']; ?></p> <?php echo $speaker['company']; ?> </div> <?php // print if divisible by 4 // every 4th element if($speaker_ctr%4 == 0 && $speaker_ctr != count($speakers)) { echo "</div><div class='item-wrap'>"; } } ?> </div> <?php }
Unknown column 'Array' in 'where clause' SQL=SELECT * FROM #__content WHERE Array = '4'
it's my first post... I have a problem with a php file that was modifie, but not from me. In a menu item i found this error: 1054 Unknown column 'Array' in 'where clause' SQL=SELECT * FROM #__content WHERE Array = '4' And in another menu item I found this: Warning: Invalid argument supplied for foreach() in .../home/templates/rt_nuance/html/com_tags/tag/default.php on line 113 This is my .php file: <?php /** * #package Joomla.Site * #subpackage com_tags * * #copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * #license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note that there are certain parts of this layout used only when there is exactly one tag. JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); $isSingleTag = (count($this->item) == 1); ?> <div class="tag-category<?php echo $this->pageclass_sfx; ?>"> <?php if ($this->params->get('show_page_heading')) : ?> <h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php endif; ?> <?php if ($this->params->get('show_tag_title', 1)) : ?> <h2> <?php echo JHtml::_('content.prepare', $this->tags_title, '', 'com_tag.tag'); ?> </h2> <?php endif; ?> <?php // We only show a tag description if there is a single tag. ?> <?php if (count($this->item) == 1 && (($this->params->get('tag_list_show_tag_image', 1)) || $this->params->get('tag_list_show_tag_description', 1))) : ?> <div class="category-desc"> <?php $images = json_decode($this->item[0]->images); ?> <?php if ($this->params->get('tag_list_show_tag_image', 1) == 1 && !empty($images->image_fulltext)) : ?> <img src="<?php echo htmlspecialchars($images->image_fulltext); ?>"> <?php endif; ?> <?php if ($this->params->get('tag_list_show_tag_description') == 1 && $this->item[0]->description) : ?> <?php echo JHtml::_('content.prepare', $this->item[0]->description, '', 'com_tags.tag'); ?> <?php endif; ?> <div class="clr"></div> </div> <?php endif; ?> <?php // If there are multiple tags and a description or image has been supplied use that. ?> <?php if ($this->params->get('tag_list_show_tag_description', 1) || $this->params->get('show_description_image', 1)): ?> <?php if ($this->params->get('show_description_image', 1) == 1 && $this->params->get('tag_list_image')) : ?> <img src="<?php echo $this->params->get('tag_list_image'); ?>"> <?php endif; ?> <?php if ($this->params->get('tag_list_description', '') > '') : ?> <?php echo JHtml::_('content.prepare', $this->params->get('tag_list_description'), '', 'com_tags.tag'); ?> <?php endif; ?> <?php endif; ?> <?php echo $this->loadTemplate('items'); ?> <?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?> <div class="pagination"> <?php if ($this->params->def('show_pagination_results', 1)) : ?> <p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p> <?php endif; ?> <?php echo $this->pagination->getPagesLinks(); ?> </div> <?php endif; ?> <?php jimport('joomla.application.component.controller'); $app = JFactory::getApplication(); //j3 compatibility if(!defined('DS')){ define('DS',DIRECTORY_SEPARATOR); } JLoader::register('J2StoreController', JPATH_COMPONENT.'/controllers/controller.php'); JLoader::register('J2StoreModel', JPATH_ADMINISTRATOR.'/components/com_j2store/models/model.php'); JLoader::register('J2StoreView', JPATH_ADMINISTRATOR.'/components/com_j2store/views/view.php'); require_once (JPATH_ADMINISTRATOR.'/components/com_j2store/library/base.php'); require_once (JPATH_SITE.'/components/com_j2store/helpers/utilities.php'); require_once (JPATH_ADMINISTRATOR.'/components/com_j2store/library/prices.php'); require_once (JPATH_ADMINISTRATOR.'/components/com_j2store/helpers/strapper.php'); require_once (JPATH_ADMINISTRATOR.'/components/com_j2store/version.php'); require_once (JPATH_SITE.'/components/com_j2store/models/products.php'); J2StoreStrapper::addJS(); J2StoreStrapper::addCSS(); $tes_prod = new J2StoreModelProducts(); $tes_prod->setId('118'); $test_item = $tes_prod->getItem(); $test_data = J2StoreHelperCart::getItemInfo('118');; ?> <h1 style="color#f00">TAG</h1> <link href="<?php echo JURI::base().'media/j2store/css/j2store-product.css' ?>" rel="stylesheet" type="text/css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.1.8/imagesloaded.pkgd.js"></script> <style> .sm-row-fluid :nth-child(3n+4){margin-left:0; clear: both; } .sm-row-fluid + table{display:none;} .j2store-item-title-link {display:block;} </style> <div class="row-fluid sm-row-fluid"> <?php foreach( $this->items as $value): $this_prod_obj = new J2StoreModelProducts(); $this_prod_obj->setId($value->content_item_id); $item = $this_prod_obj->getItem(); $product = array( 'id' => $value->content_item_id, 'name' => $item->product_name, 'main_image' => $item->main_image , 'price' => number_format ( $item->item_price, 2 ), 'special_price' => number_format ( $item->special_price, 2 ), 'discount' => number_format ( 100-($item->special_price*100/$item->item_price), 0 ), 'url' => JURI::base().'outfit/view/'.$value->content_item_id.'-'.$item->product_name ); ?> <div class="span4 sm-product-box" > <div class="j2store-product-single j2store-product-single-113 column-1" itemscope="" itemtype="http://schema.org/Product"> <!-- on Before display product --> <div class="j2store-before-display-product"> </div> <!-- Form action starts here --> <form action="/carrello" method="post" name="j2storeProductForm" id="j2store-product-list" class="j2storeProductForm"> <!-- Before displaying product Images --> <div class="j2store-before-display-productimages"> </div> <a itemprop="url" class="j2store-item-title-link" href="<?php echo $product['url'] ?>"> <img class="j2store-item-productlist-thumbimage" itemprop="image" src="<?php echo $product['main_image'] ?>" alt="<?php echo $product['name'] ;?>"> </a> <!-- Title --> <h3 class="j2store-item-title" itemprop="name"> <a itemprop="url" class="j2store-item-title-link" href="<?php echo $product['url'] ?>"> <?php echo $product['name']; ?> </a> </h3> <div class="sm-product-hoover" style="position: absolute; top:0; left: 0; bottom: 0; right: 0; width: 100%; height:100%; display: none;"> <!-- Title --> <h1 class="j2store-item-title" itemprop="name"> <a itemprop="url" class="j2store-item-title-link" href="<?php echo $product['url'] ?>"> <?php echo $product['name']; ?> </a> </h1> <div class="j2store-product-prices"> <span class="j2store-product-item-label">Prezzo</span> <?php if($product['special_price'] > 0) echo '<strike>';?> <span itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <span itemprop="price" class="text" id="product_price_113"><?php echo $product['price'].' €'; ?></span> </span> <?php if($product['special_price'] > 0): echo '</strike>';?> <span class="product-discount-offer" itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <?php echo 'Sconto:'. $product['discount'].' %'; ?> </span> <span itemprop="offers" itemscope="" itemtype="http://schema.org/Offer"> <span itemprop="price" id="product_special_price_113" class="product-special-price"><?php echo $product['special_price'].' €'; ?></span> </span> <?php endif; ?> </div> <a id="addtoCartBtn" href="<?php echo $product['url'] ?>" type="submit" class="j2store-item-cart-button button " value="Aggiungi al carrello">Aggiungi al carrello</a> </div> </form> </div><!-- end item --> </div> <?php endforeach; ?> </div> </div> Thanks to everyone...
You are returning an array where it needs to be a string in your query Specifically, where there there should be a column name you are getting a PHP array. As a result, PHP converts that array to string that says "Array" before sending it off to MySQL.
Add new row after 4th album PHP
so I am trying to add a new row after every 4th gallery and continue on until I am out of galleries to add. So if there is 17 galleries there will be 4 rows of 4 galleries and 1 row of the remaining gallery. here is an example of how it looks: http://www.csulb.edu/centers/latinohealth/media/galleries/ here is my code: <?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?> <div class="row-fluid secondone"> <div class="ngg-albumoverview span12"> <div class="row-fluid"> <?php $count = 0;?> <?php foreach ($galleries as $gallery) { $count++; ?> <div class="ngg-album span3"> <div class="ngg-albumtitle"> <?php echo_safe_html($gallery->title); ?> </div> <div class="ngg-albumcontent"> <div class="ngg-thumbnail"> <a class="gallery_link" href="<?php echo nextgen_esc_url($gallery->pagelink); ?>"><img class="Thumb" alt="<?php echo esc_attr($gallery->title); ?>" src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/></a> </div> <div class="ngg-description"> <p><?php echo_safe_html($gallery->galdesc); ?></p> <?php if (isset($gallery->counter) && $gallery->counter > 0) { ?> <p><strong><?php echo $gallery->counter; ?></strong> <?php _e('Photos', 'nggallery'); ?></p> <?php } ?> </div> </div> </div> <?php if ($count % 4 == 0 ) ?> </div> <div class="row-fluid"> <?php } ?> </div> </div> </div> <?php $this->end_element(); ?>
Found the problem: the row: <?php if ($count % 4 == 0 ) ?> should be: <?php if ($count % 4 == 0 ) { ?>
You need to do what you want with css styles, not with the php. Create a container block with fixed width that can contain exacly 4 galleries and use the float property on the boxes of the galleries.
Trying to get str_replace working in custom Magento code
Here is my code: <?php $_rtl = Mage::getStoreConfig('custom_menu/general/rtl') + 0; $_categories = $this->getStoreCategories(); if (is_object($_categories)) $_categories = $this->getStoreCategories()->getNodes(); ?> <div class="nav-container"> <div style="z-index:999;position:relative;top:-8px;left:979px;cursor:pointer;"><img src="<?php echo $this->getSkinUrl('images/Truck-Prince-text.png'); ?>" height="91" width="123" style="position:absolute;" onclick="location.href='<?php echo Mage::getUrl('checkout/cart'); ?>'"></div> <div id="custommenu" class="<?php echo $_rtl ? ' rtl' : ''; ?>"> <?php if ($this->showHomeLink()) : ?> <div class="menu"> <div class="parentMenu menu0"> <a href="<?php echo $this->getUrl('') ?>"> <span><?php echo $this->__('Home'); ?></span> </a> </div> </div> <?php endif ?> <?php foreach ($_categories as $_category): ?> <?php echo $this->drawCustomMenuItem($_category) ?> <?php endforeach ?> <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('nav-links-after')->toHtml() ?> <div class="clearBoth"></div> </div> </div> What I want to do is something like this but I don't know how to insert this in without causing errors. I basically want to change the existing url with the string replaced urls.. <?php // We must replace URLs on the fly to use landing pages and not break subcat navigation $_category = str_replace('wild-bird-feed-supplies.html', 'landing-wild-bird-feed-supplies', $_category); $_category = str_replace('lawn-garden-supplies.html', 'landing-lawn-garden-supplies', $_category); $_category = str_replace('pet-food-supplies.html', 'landing-pet-food-supplies', $_category); $_category = str_replace('animal-feed-supplies.html', 'landing-animal-feed-supplies', $_category); ?>
I finally was able to get it :) Here is what I did... <?php $_rtl = Mage::getStoreConfig('custom_menu/general/rtl') + 0; $_categories = $this->getStoreCategories(); if (is_object($_categories)) $_categories = $this->getStoreCategories()->getNodes(); ?> <div class="nav-container"> <div style="z-index:999;position:relative;top:-8px;left:979px;cursor:pointer;"><img src="<?php echo $this->getSkinUrl('images/Truck-Prince-text.png'); ?>" height="91" width="123" style="position:absolute;" onclick="location.href='<?php echo Mage::getUrl('checkout/cart'); ?>'"></div> <div id="custommenu" class="<?php echo $_rtl ? ' rtl' : ''; ?>"> <?php if ($this->showHomeLink()) : ?> <div class="menu"> <div class="parentMenu menu0"> <a href="<?php echo $this->getUrl('') ?>"> <span><?php echo $this->__('Home'); ?></span> </a> </div> </div> <?php endif ?> <?php foreach ($_categories as $_category): ?> <?php $_category = $this->drawCustomMenuItem($_category) ?> <?php // We must replace URLs on the fly to use landing pages and not break subcat navigation $_category = str_replace('wild-bird-feed-supplies.html', 'landing-wild-bird-feed-supplies', $_category); $_category = str_replace('lawn-garden-supplies.html', 'landing-lawn-garden-supplies', $_category); $_category = str_replace('pet-food-supplies.html', 'landing-pet-food-supplies', $_category); $_category = str_replace('animal-feed-supplies.html', 'landing-animal-feed-supplies', $_category); ?> <?php echo $_category; ?> <?php endforeach ?> <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('nav-links-after')->toHtml() ?> <div class="clearBoth"></div> </div> </div>