Wordpress Theme + SMOF Slider - php

I'm currently developing a Wordpress theme for a personal website and decided to use the Slightly Modded Options Framework [SMOF] to make things easy. Everything has gone pretty well so far, it's indeed an awesome framework. Today I decided to use the built-on slider option the came within the Framework and implement it on my theme and here is where I found my self a little bit lost.
I managed to make the theme and framework show the slideshow, but it won't rotate/circle/slide/fade the images. It's only showing the first image, it stay still and won't change slides.
Here is my code in case that someone has knowledge with SMOF:
This is what I have on my functions.php:
$of_options[] = array( "name" => "Homepage Slideshow",
"desc" => "Slider Option Description",
"id" => "homepage_slider",
"std" => "",
"type" => "slider"
);
This is what I have on my theme index.php:
<?php $slides = $data['homepage_slider']; if ($slides) { ?>
<!-- Start my Precio... uhum! I mean Slider -->
<?php
foreach ($slides as $slide) {
}
?>
<?php if (!empty ($slide['link'])) { ?>
<a href="<?php echo $slide['link']; ?>" title="<?php echo htmlspecialchars(stripslashes($slide['title'])); ?>">
<img src="<?php echo $slide['url']; ?>" width="950" height="369px" alt="<?php echo htmlspecialchars(stripslashes($slide['title'])); ?>" style="height: 369px; width: 100%;"/>
</a>
<?php } else { ?>
<img src="<?php echo $slide['url']; ?>" width="950" height="369px" alt="<?php echo htmlspecialchars(stripslashes($slide['title'])); ?>" style="height: 369px; width: 100%;"/>
<?php } ?>
<?php if (count($slides) > 1) { ?>
<!-- Die Slider! -->
<?php
} // End count
?>
<?php
} // End if
?>
Probably the issue resides on the loop, but honestly I have tried many ways and couldn't make it swap images. I'll really appreciate any tips and directions that help me work this out. Thanks everyone!

I am also using smof v 1.5 in a wordpress theme project. I've faced the same problem but after some research i've solved the issue. By using the following codes you can get the slider's each slide's values.
<?php
global $smof_data;
$slides = $smof_data['example_slider']; //get the slides array
foreach ($slides as $slide) {
echo $slide['title'];
echo $slide['url'];
echo $slide['link'];
echo $slide['description'];
}
?>
By using this code you can access each option element of smof and the key is "global $smof_data;" its not documented but i got if after reading ninezeroseven wordpress theme admin options files. Authors of ninezeroseven used this SMOF and i got the clue from the author coding. I've tried global variable $smof_data instead of $data and its works.

Related

Custom template use event expresso plugin Wordpress

client using event expresso 3 to build an table to display list of the class they provide. but I need to create custom template instead the default one.
I look into their documentation, taking me really long time to understand, I have couple tried, but not able to make it work.
1. Location is not pulling
<?php $event_location = get_post_meta($post->ID, 'event_location', true); ?>
<div class="location">
<h5<?php echo $event_location; ?></h5>
</div>
2. I keep getting error from this line also.
error: undefined : $image_url['event_thumbnail_url']
<?php if ($image_url['event_thumbnail_url']) { ?>
<img id="" class="" src="<?php echo
$image_url['event_thumbnail_url']; ?>" <?php } ?>
My client purchased the plugin, so I don't have access to their support forum

It is not displaying all images

I have a application here: application
In the demo I am using a basic jquery slider which page is here: page info
Now the issue I am having is that it displays the images in question 1, but not in question 2. Now before I included the slider, it displayed the images in all questions. But since I included the slider, then it only displays images in first question only. How can I get images to be displayed in all questions?
CODE:
<form action='results.php' method='post' id='exam'>
<?php
foreach ($arrQuestionId as $key=>$question) {
?>
<div class='lt-container'>
<p><?php echo htmlspecialchars($arrQuestionNo[$key]) . ": " . htmlspecialchars($arrQuestionContent[$key]); ?></p>
<?php
//start:procedure image
$img_result = '';
if(empty($arrImageFile[$key])){
$img_result = ' ';
}else{
?>
<div id="banner-slide">
<ul class="bjqs">
<?php foreach ($arrImageFile[$key] as $i) { ?>
<li><img alt="<?php echo $i; ?>" height="200" width="200" src="<?php echo 'ImageFiles/'.$i; ?>"></li>
<?php } ?>
</ul>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#banner-slide').bjqs({
animtype : 'slide',
height : 200,
width : 200,
responsive : true,
randomstart : true
});
});
</script>
<?php
}
//end:procedure image
?>
</div>
<?php
}
?>
</form>
You have two divs on the page with the same ID. #1 that is a no no and bad HTML. You will need to initiate your slider on each div independently.
$('#banner-slide1').bjqs({ //ETC
$('#banner-slide2').bjqs({ //ETC
Is that enough to understand where you went wrong and why it's not working. JQuery doesn't know which banner-slide to use, or it's actually only using the first one, because it knows there should only be one ID per page.
I don't know how your slider plugin works, but you may be able to change the ids to classes in the divs, and then start the slider with:
$('.banner-slide').bjqs({ //ETC
OR
$('.banner-slide').each(function(){
$(this).bjqs({ //ETC
It depends on how the plugin works.
Element ID should be unique to a single element. You are not allowed to give two elements the same ID. Try changing the IDs to banner-slide1 and banner-slide2.

Magento - cart not showing and checkout/cart page empty (doesn't show the .cart div)

Okay, so I'm a newbie to Magento and have been making lots of changes to get it working the way a client is wanting.
Obviously at install and early on, the shopping cart was working fine. I moved it up to the top right corner for a while w/ CSS and then I THOUGHT that I display:none'd it, as I just wanted to focus on other things for a while before moving on to styling it. Now I've done all those other things and want to deal with the cart. Trouble is - it is nowhere to be found and the display:none that I thought I'd used to turn it off is similarly missing. Maybe I never did it?
I can't find anything in the CSS that would have turned off the cart - I can't find a display:none on it or any parents. Most of the site is using a 2 column with left sidebar layout, and I know the shopping cart resides by default in the right. But when I turn back on the right sidebar - no cart. Furthermore, when I go to add a product to the cart, I am redirected to mydomain.com/checkout/cart as expected, but there is nothing on the page. My styling, menus, etc are present but the .col-main element where the full-page detailed cart should be is empty. Which makes me think again that the problem isn't CSS.
It's as if the site just isn't calling for the cart (I assume cart.phtml?). It is totally possible that I screwed something up while messing with other things (adding a CMS page menu at top, lots to do with resizing images, moving the category menu to the left sidebar). My php isn't good enough to find the culprit and I'm not even sure which file I should be looking at - checkout.phtml?
I realize this question has very little valuable information, but does anyone have any ideas as to where I should be looking? I can post the relevant code if I know which file to look in. The site is cart.oldfloridian.com. If you want to try to add a product, there is only one at the moment, at "ak starfish --> starfish women's"
Edit: so the /checkout/cart page is a 3column layout. Here is the 3columns.phtml code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<head>
<?php echo $this->getChildHtml('head') ?>
</head>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<div id="cms-menu">
<?php $collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());?>
<?php $collection->getSelect()
->where('is_active = 1'); ?>
<ul>
<?php foreach ($collection as $page): ?>
<?php $PageData = $page->getData(); ?>
<?php if($PageData['identifier']!='no-route') { ?>
<li>
<?php echo $PageData['title'] ?>
</li>
<?php } ?>
<?php endforeach; ?>
</ul>
</div>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices') ?>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col3-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-wrapper">
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div>
</div>
<div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
There does seem to be a bug in there somewhere - we had a similar issue where two devs in the team couldnt see the cart, 1 could - but it wasnt just the cart it was the whole customer section (login, cart, my account etc).
We tried enabling Template Path Hints but the only thing in the main section of the page was "frontend/default/default/template/catalog/msrp/popup.phtml". We re-installed most of magento - no luck
We tried pretty much everything and what fixed it was coping all of the theme files into a new theme and re-naming it. Only thing I can think of that it could have been was a hyphen in the theme name

balita theme / nivo slider transition

I'm using the 'Balita' free ecommerce wordpress theme. It comes stock with 'nivo' slider hooked to the dashboard. This is fine, but doesn't allow slide transition customizations and is left at crazy 'random' at default. I'd like to use 'fade' but can't find where the theme is calling the jQuery.
All I see is the initiation code below; within the header.php
<?php
// get recent slider max is 5 slider.
tk_get_recent_posttype('slider', 1, 5);
if(have_posts ()):
?>
<div class="slider-wrapper theme-default">
<div id="slider" class="nivoSlider">
<?php
while (have_posts ()): the_post();
echo '<a href="'. get_post_meta(get_the_ID(), '_tk_slider_meta_link', true).'">';
the_post_thumbnail('slider', array('alt' => get_the_title(), 'title' => ''));
echo '</a>';
endwhile;
?>
</div>
</div>
<?php endif; wp_reset_query(); ?>
I've also tried dragging the tradtional jQuery code above this within the same head to toggle 'fade' but it ignores it. How could I change the slide transitions / where could I find the jQuery? Or am I stuck to working with a new plugin?
I find the script to edit within an open source FTP client called 'script.js'. Rad, good to go.

OpenCart: Where is the div for the drop down header cart info?

I am trying to style OpenCart but am having difficulty finding which TPL file holds the div that appears when you click the Shopping Cart icon in the header (the 'mini cart' that slides down - it allows you to view what's in your cart without going to the cart page).
Does anyone know where I can find the .tpl file that has this div (in the default structure template)? Thanks
Why did people downvote you?
The #content DIV sits within the #cart DIV - you should have searched this.
Open /catalog/view/theme/default/template/common/header.tpl
The cart header is in the echo
<?php echo $cart; ?>
To see the code view /catalog/view/theme/default/template/module/cart.tpl (in version v1.5.3.1)
The section is in the top within .mini-cart-info class. Example from some of the code snippet below:
<div id="cart">
<div class="heading">
<h4><?php echo $heading_title; ?></h4>
<a><span id="cart-total"><?php echo $text_items; ?></span></a></div>
<div class="content">
<?php if ($products || $vouchers) { ?>
<div class="mini-cart-info">
<table>
<?php foreach ($products as $product) { ?>
<tr>
<td class="image"><?php if ($product['thumb']) { ?>
<img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" />
<?php } ?></td>
<td class="name"><?php echo $product['name']; ?>
<div>
I agree With #TheBlackBenzKid.
1) View file can be found with below path
"catalog/view/theme/default/template/module/cart.tpl" .
2) Controller file can be found with below path
"catalog/controller/module/cart.php" .
Below link can provide you where to modify the files related to the header drop-down cart. I have give instruction how to modify and created another drop down similar with previous.
Please have a look on this link "https://github.com/pantlavanya/copy-opencart-mini-cart"

Categories