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
Related
Basically, I am trying to display ratings (using kk star rating plugin) for different past bookings in my plugin. I am using do_shortcode() for different bookings with different ids. This is being echoed in a partial file.
<?php
/* GIVE RATINGS IF NOT ALREADY GIVEN */
if ($ratings_possible) {
echo do_shortcode("[kkstarratings id=" . $booking->id . "]");
?>
Here $booking->id is giving a unique booking id number based on which I am trying to get unique rating for each booking.
Issue
Currently, main file runs loop three times and this snippet does display stars perfectly, but of those three star-bar, last one is actually working. Last one accepts the ratings and updates the average, but the first two are not working. We can hover over all there stars-bar and click, but the only last one of it is actually working.
I have also used kk_star_ratings() method but same result.
More details
The following is a part of dashboard.php code. It is displaying every appointment/booking of a customer. Here $customer->future_bookings is displaying upcoming bookings (where obviously $ratings_possible is set to false). However, on $customer->past_bookings I have set $ratings_possible to true. Followed by the partial file that is responsible for each booking detail i.e. include('_booking_tile.php');
dashboard.php
<div class="customer-bookings-tiles">
<?php
foreach($customer->future_bookings as $booking){
$editable_booking = true;
$ratings_possible = false;
include('_booking_tile.php');
} ?>
</div>
<?php } ?>
<?php
if($customer->past_bookings){ ?>
<div class="latepoint-section-heading-w">
<h5 class="latepoint-section-heading"><?php _e('Past '.$appointterm, 'latepoint'); ?></h5>
<div class="heading-extra"><?php printf( __('%d '.$appointterm, 'latepoint'), count($customer->past_bookings)); ?></div>
</div>
<div class="customer-bookings-tiles">
<?php
foreach($customer->past_bookings as $booking){
$editable_booking = false;
$ratings_possible = true;
include('_booking_tile.php');
} ?>
</div>
Now, on the _booking_tile.php, it contains details of each booking like agent, time, status etc. Through $booking object we are getting the variables of a particular booking and their values and everything. Here is some part of code:
_booking_tile.php
<div class="customer-booking-info-row">
<span class="booking-info-label"><?php _e($agentterm, 'latepoint'); ?></span>
<span class="booking-info-value"><?php echo $booking->agent->full_name; ?></span></div>
<div class="customer-booking-info-row">
<span class="booking-info-label"><?php _e('Status', 'latepoint'); ?></span>
<span class="booking-info-value status-<?php echo $booking->status; ?>"><?php echo $booking->nice_status; ?></span></div>
</div>
<?php if ($editable_booking) { ?>
<div class="customer-booking-buttons">
<a href="<?php echo $booking->ical_download_link; ?>" target="_blank" class="latepoint-btn latepoint-btn-primary latepoint-btn-link">
<i class="latepoint-icon latepoint-icon-ui-83"></i>
<span><?php _e('Add to Calendar', 'latepoint'); ?></span>
</a>
<?php /* <i class="latepoint-icon latepoint-icon-ui-46"></i><span><?php _e('Edit', 'latepoint'); ?></span> */ ?>
<a href="#" class="latepoint-btn latepoint-btn-danger latepoint-request-booking-cancellation latepoint-btn-link" data-route="<?php echo OsRouterHelper::build_route_name('bookings', 'request_cancellation'); ?>">
<i class="latepoint-icon latepoint-icon-ui-24"></i>
<span><?php _e('Cancel', 'latepoint'); ?></span>
</a>
</div>
<?php } ?>
<?php /* GIVE RATINGS IF NOT ALREADY GIVEN */
if ($ratings_possible) {
echo do_shortcode("[kkstarratings id=" . $booking->id . "]");
?>
<?php } ?>
Resulting HTML code is perfectly fine, every rating-star (kk star plugin) has perfect code it has unique IDs meaning it should work fine. Moreover, as I said before when I insert three shortcodes with different IDs, it works fine.
That stars are displaying perfectly, but only the third one is actually working. When I click third one it records my rating and displays the average. While first two are not.
Stars work when I insert their shortcodes manually through WordPress. So it means that multiple shortcodes with IDs is possible.
Author provides kk_star_rating() function that can be used in the code, but it gives same result.
Only the last star is working others are just not recording anything. All three have same resulting HTML code except for the IDs which will be unique.
I will be happy to answer more of your questions.
Here's the screenshot, Third one is giving me the result when I click. But I can only hover over the first two and click multiple times with no result.
Screenshot
It was some sort of problem with the plugin. It was not compatible with newest version of WordPress. Used a different plugin and it worked fine. Calling multiple shortcodes through a loop worked perfectly.
Thanks to everyone who tried to help.
Hello and thanks for reading. I am a .NET developer and don't know PHP (Although I am working on learning on the job) and what I am working on was made my consultants that we dont have contact with anymore. When a news post is clicked it appears to display using a template single.php. Followed is the code for this page:
<div id="marketBanner">
<div id="banner">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/services-banner.jpg" alt="" />
</div>
<div id="breadcrumbWrap">
<div id="breadcrumbs">
<?php
if(function_exists('bcn_display'))
{
bcn_display();
}
?>
</div>
</div>
</div>
<div id="content">
<div class="left">
<h2><?php the_title(); ?></h2><br />
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="the_details">
Posted: <?php the_date(); ?> | View All News
</div>
<?php the_content(''); ?>
<?php endwhile; endif; ?>
</div>
Why does this page get used when a post is chosen? I want only a certain category of post to use this page and another category of post to use a different template. How do I achieve this?
You need to study the Wordpress Template Hierarchy # https://codex.wordpress.org/Template_Hierarchy#Single_Post_display
A template (PHP file) is looked for in this order (only on wordpress).
1 - single-{post_type}.php - If the post type were product, WordPress would look for single-
2 - product.php
3 - single.php
4 - index.php
In your case I would use single.php to create a template for the average post then specifically create a template for the one you want different using single-'post_type'.php
You can change the post type when creating a post.
Take a look at the Wordpress Template Hierarchy. It explains which templates get used and will probably be super helpful if you're just starting out with WP. You can use WP syntax to create category pages - but at the archive level - not the single post level.
To create separate pages based on post categories see here and below:
<?php
$post = $wp_query->post;
if (in_category(9)) {
include (TEMPLATEPATH.'/single-specific9.php');
return;
}
if (in_category(8)) {
include (TEMPLATEPATH.'/single-specific8.php');
return;
}
if (in_category(11)) {
include (TEMPLATEPATH.'/single-specific11.php');
return;
}
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.
How do I create new product custom options type in magento?
For example, I have to give new image a custom option type in magento which fetches an image from my custom module table, and I want to assign that image to my custom options image field.
As Dustin Graham said, it is very tricky. First steps:
Add new node under global/catalog/product/options/custom/groups. See examples in /app/code/core/Mage/Catalog/etc/config.xml.
Create new block to render your custom option.
Rewrite Mage_Catalog_Model_Product_Option and implement saving your custom type options (saveOptions() method) and loading your custom type options (getProductOptionCollection method).
If your custom type isn't very custom :) - it should be enough.
I forgot this question but i need again to create new custom option type in my another project. I had Created new custom options type using this link.
http://magento.ikantam.com/qa/custom-input-types-custom-options
Solution is bit lengthy and its not possible to put whole code here, so i have just share this link, going through this link i had create new custom options type easily, explanation is good in this article.
I have modify some changes for my need .
Hope this will help some one.
As Dustin Graham said its incredibly tricky.
#Mufaddal thanks for sharing this link. I'd like to offer an alternative to this since it requires quite a bit knowledge.
If you're only trying to change the way a specific dropdown (for example) is displayed you can also overwrite the /template/catalog/product/view/options/type/select.phtml as follows:
`
getOption() ?>
<dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label> </dt>
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
<div class="input-box">
<?php echo $this->getValuesHtml(); ?>
<?php if($_option->option_id == 2) : ?>
<script type="text/javascript">
jQuery('#select_2').css('display', 'none');
</script>
<?php foreach ($_option->getValues() as $_value) { ?>
<?php echo $_value->getTitle(); // the title of the option ?>
<?php echo $_value->getOptionTypeId(); // the id ?>
<?php } ?>
<!-- add custom code that triggers select in the background -->
<?php endif ?>
<?php if ($_option->getIsRequire()): ?>
<?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX): ?>
<span id="options-<?php echo $_option->getId() ?>-container"></span>
<?php endif; ?>
<?php endif;?>
</div>
`
You can then hide the select and interact with the select through jQuery.
I am using the zend google api library to retrieve a list of event from a public calendar. I am successfully able to retrieve the title, when, and content, but where is an empty array. Any documentation that I have found in the past 3 hours from Google, Zend or otherwise is terrible and does not give a list of possible values. The only documentation I can find on the location of the event is how to set it if you are creating an event.
How do I access the location?
<?php
foreach ($eventFeed as $event) :
?>
<li>
<div class="event_title">
<?php echo $event->title->text;?>
</div>
<div class="event_time">
<?php echo date('h:ia', strtotime($event->when[0]->startTime));?>
</div>
<div class="event_location">
<?php echo $event->where?>
</div>
<div class="event_description">
<?php echo $event->content->text?>
</div>
</li>
<?php
endforeach;
?>
$where=$event->Where;
foreach($where as $eventplace)
{
echo $eventplace;
}
It will give you location.
The main reason is that it gives the location value in array so we have to find it out manually....