Solved

Word Press Calender Plugin - adding a <div> tag

Posted on 2010-08-27
21
646 Views
Last Modified: 2014-11-12
I have added the events calender plug in

It works just fine, but you can see I need to make a change to keep it constrained within my template.

Sizzle Softball

I tried to fix with their help forum and the advise was to:
You need to add a body block div at the beginning of the calendar and one at the end. Best approach is to make a custom template following the direction (make a /events/ folder in your theme, copy over the proper files) and add the missing lines of code.
at the begining of the ECP templates add:
<div id="body_block" class="full_width framed primary_blue">
and at the end add:
</div>

I tried that with no success, then the second comment was:

you need to put that code at the top and bottom of each of the event templates.

Since this is word press, it has me a bit confused on how to fix this problem.
I realize that I need to place this code to wrap it all up, just not sure where.

Thanks for any help.
Brent

0
Comment
Question by:bvanscoy678
  • 12
  • 9
21 Comments
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548037
Looking at your code, you are missing a <div> statement.  <div id="body_block">. Add it to above your <div class="grid" id=tec-content"> line.
<div id="body_block">
<div class="grid" id="tec-content">
            <div class="clearfix" id="tec-events-calendar-header">

....
</div>
</div>  

and don't forget to add the final </div> to close it out.

I have added an image to demonstrate that it works.
sizzlesoftball.png
0
 

Author Comment

by:bvanscoy678
ID: 33548049
I don't see a <div> class grid?

I was able to add
<div id="body_block" class="full_width framed primary_blue">
in the very bottom of my header and a </div> at the very top of my footer.
that worked until I clicked on the view event and that was all jacked up.

I'll look again.

Thanks



<?php

/*
Template Name: Full Width Template
*/

get_header();

require(WEBTREATS_INCLUDES . "/var.php");





if ($post->ID == $blog_page) {
	return require(WEBTREATS_INCLUDES . "/template-blog.php");
}else{ 

?>

<div id="body_block" <?php webtreats_body_class(); ?>>
	
	<?php if($home_slider_page) { webtreats_header_slider_switcher($homepage_slider); } ?>
	
	<?php webtreats_teaser_text($post->ID); ?>

Open in new window

0
 

Author Comment

by:bvanscoy678
ID: 33548053

<?php



/*

Template Name: Full Width Template

*/



get_header();



require(WEBTREATS_INCLUDES . "/var.php");











if ($post->ID == $blog_page) {

	return require(WEBTREATS_INCLUDES . "/template-blog.php");

}else{ 



?>



<div id="body_block" <?php webtreats_body_class(); ?>>

	

	<?php if($home_slider_page) { webtreats_header_slider_switcher($homepage_slider); } ?>

	

	<?php webtreats_teaser_text($post->ID); ?>



<div id="body_block_background">

<div class="inner">

<div id="body_block" class="full_width framed primary_blue">

	





	<?php $breadcrumb_page_disable = get_post_meta($post->ID, 'breadcrumb_page_disable', true);

			if (!$breadcrumb_disable && !$breadcrumb_page_disable){ if (class_exists('simple_breadcrumb')) { $bc = new simple_breadcrumb; }} ?>



		<div id="main">

			<div class="content">

		

			<?php if(have_posts()) : while(have_posts()) : the_post(); ?>

			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

				

				<?php $teaser_text = get_post_meta($post->ID, 'teaser_text', true); 

				 		if ($teaser_text == 'default' && $header_teaser == 'disable' || $teaser_text == 'disable') { ?>

				<?php echo webtreats_title($post->ID); ?>

				<?php } ?>	



					<?php the_content(); ?>

					<div class="clearboth"></div>



			<?php wp_link_pages('before=<div id="page-links">Pages: &after=</div>'); ?>



		</div> <!-- .post -->

	

	<div class="clearboth"></div>



	<div id="comments">

		<?php comments_template('', true); ?>

	</div>



	<?php endwhile; endif; ?>

	

	</div> <!-- content -->

</div> <!-- main -->





<?php get_footer(); ?>







<?php } ?>

Open in new window

0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548061
I am using a Firebug plugin for Firefox.  Here is what the code looks like, when I added the
<div id="body_block" class="full_width framed primary_blue">.   Since the plugin is a premium paid plugin I cannot access the code to determine exact placement, only the appropriate placement.
sizzlesoftball2.png
0
 

Author Comment

by:bvanscoy678
ID: 33548062
Ok, I used firebug and I think I see where you are talking about.

I haven't edited wtih firebug before. I guess I can make the changes right there on the screen?
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548065
A better screenshot of the expanded code.
sizzlesoftball3.png
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548069
You can make the changes, but they are not permanent.  The right hand side of the page will show you the css name and location of what is being displayed.  Since we are not changing the stylesheets, your template will need to be edited, likely the event calendar template (if i read through their site correctly).
0
 

Author Comment

by:bvanscoy678
ID: 33548071
Where does the </div> go?

Clear at the very bottom?

thanks
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548073
This may help.  If you look at the code with firebug of your homepage, you will see that the <div id="body_block" class="full_width framed primary_blue"> is present.  If you understand how that is used throughout your site, the events calendar page maybe a little easier to "fix".
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548077
In the image above it is the last </div>.

It is the final </div> above the <div class="clearboth"></div>
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:bvanscoy678
ID: 33548087
Yes, this is the issue I am having. I can't find the calender template. The calender pro works off of a post.

Then I made a page called team schedule and used a full width template as my page.

I'll look again in my admin. Thanks
0
 

Author Comment

by:bvanscoy678
ID: 33548091
the code I submitted at first is a copy of the full width template.
0
 

Author Comment

by:bvanscoy678
ID: 33548111
The code you are showing make sense to me. Just finding it in my website has been difficult for me. I am on day 3!  I bought the plug in because I liked it and thought it would be easier than others. Boy, was I wrong. My knowledge of all this is minimal, that explains why I use wordpress templates. it is for my kids team, kinda a hobby.

0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548128
Would you be able to provide the code for the page that you created?  The code I am looking at above contains the line <div id="body_block" <?php webtreats_body_class(); ?>> which I would believe to be <div id="body_block" class="full_width framed primary_blue">.  However, do not see that code on your calendar page.  Something from that page is missing.
0
 

Author Comment

by:bvanscoy678
ID: 33548135
I can provide you access to the website. It is just in the beginning stages and there is nothing on there to protect.

I place the code both on the full width template page and also the page.php. But, it looks a bit different than the code you showed me, so I am guessing it is not correct.

Does expert exchange have PM'S or I can email you the information.

I really am interested in how this gets fixed. it helps me understand the site  much better.

Thanks
0
 
LVL 10

Expert Comment

by:c_a_n_o_n
ID: 33548153
I do not know of any PM or email functionality.  If you are comfortable with that, be certain to change your username (maybe) and password immediately after I am done.  I cannot gaurantee that I can fix it, but I can take a look at it and try for a few minutes.  So as not to get spammed to much, please go about emailing me this way.  http://www.elvisrecords.us/contact-us/  

It is one of my sites and it has a captcha code in it.  I'll keep a watch out for your email, and can reply to you with your email address.
0
 

Author Comment

by:bvanscoy678
ID: 33548157
I found this under the plug in's with the editor. Not sure if this helps.


<?php

/*

 Plugin Name:  Events Calendar Pro

 Description:  The Events Calendar plugin enables you to rapidly create and manage events using the post editor. Features include optional Eventbrite integration, Google Maps integration as well as default calendar grid and list templates for streamlined one click installation. When updating The Events Calendar, if EventBrite for The Events Calendar is being used, the two plugins must be updated together. Requires WordPress 3.0 (or higher) and PHP 5.2 (or above). 

 Version: 1.2

 Author: Shane & Peter, Inc.

 Author URI: http://www.shaneandpeter.com/

 Text Domain: events-calendar-pro

 */





register_activation_hook(__FILE__, 'events_calendar_pro_activate');



define( 'SP_EVENTS_SUPPORTED_WP_VERSION', version_compare(get_bloginfo("version"), '3.0', '>=') );

define( 'SP_EVENTS_SUPPORTED_PHP_VERSION', version_compare( phpversion(), '5.2', '>=') );





if ( ! function_exists('events_calendar_pro_activate') ) {

	function events_calendar_pro_activate() {

		if ( SP_EVENTS_SUPPORTED_WP_VERSION && SP_EVENTS_SUPPORTED_PHP_VERSION ) {

			events_calendar_pro_load();

			global $sp_ecp;

			$sp_ecp->on_activate();

		}

	}

}



if ( ! function_exists('events_calendar_pro_load') ) {

	function events_calendar_pro_load() {

		if ( SP_EVENTS_SUPPORTED_WP_VERSION && SP_EVENTS_SUPPORTED_PHP_VERSION ) {

			$events_dir = dirname(__FILE__);

			require_once($events_dir . "/events-calendar-pro.class.php");

			require_once($events_dir . "/the-events-calendar-exception.class.php");

			require_once($events_dir . "/events-calendar-widget.class.php");

			require_once($events_dir . "/events-list-widget.class.php");

			require_once($events_dir . "/template-tags.php");

		}

	}

}



events_calendar_pro_load();



add_action('admin_head', 'sp_events_notices');

function sp_events_notices() {

	if ( ! SP_EVENTS_SUPPORTED_WP_VERSION ) {

		echo "<div class='error'><p>Events Calendar Pro requires WordPress 3.0 or higher. Please upgrade WordPress or deactivate Events Calendar Pro.</p></div>";

	}

	if ( ! SP_EVENTS_SUPPORTED_PHP_VERSION ) {

		echo "<div class='error'><p>Events Calendar Pro requires PHP 5.2 or higher. Talk to your Web host about not living in the past.</p></div>";

	}

}

Open in new window

0
 

Author Comment

by:bvanscoy678
ID: 33548167
Ok. I am comfortable with it. It is just a sports blog after all. All of my stuff is just hobbiest stuff.

Thank you.
0
 
LVL 10

Accepted Solution

by:
c_a_n_o_n earned 500 total points
ID: 33548204
You are fixed.  Hope that helps you out.  
btw.  thank you for the trust too.
0
 

Author Closing Comment

by:bvanscoy678
ID: 33548223
This guy puts the EXPERT in expert exchange!

Thanks so much.
0
 

Author Comment

by:bvanscoy678
ID: 33549978
Ok, long story short, the events folder I created needed to be placed in my theme folder, not the plug in folder. When I did that, it solved the gridview.php, but my other views are still jacked. I am working with the forum where I got it for help.


<?php

	global $sp_ecp;

	get_header();

?>	

<div id="body_block" class="full_width framed primary_blue"><?php /*Added by c_a_n_o_n */ ?>

	<div id="container">

	<div id="content" class="tec-event widecolumn">

	<?php the_post(); global $post; ?>

			<div id="post-<?php the_ID() ?>" <?php post_class() ?>>

				<span class="back"><a href="<?php echo sp_get_events_link(); ?>"><?php _e('&laquo; Back to Events', $sp_ecp->pluginDomain); ?></a></span>

				<h2 class="entry-title"><?php the_title() ?></h2>

				<?php if (sp_get_end_date() > time()  ) { ?><small><?php  _e('This event has passed.', $sp_ecp->pluginDomain) ?></small> <?php } ?>

				<div id="tec-event-meta">

					<dl class="column">

						<dt><?php _e('Start:', $sp_ecp->pluginDomain) ?></dt> 

							<dd><?php echo sp_get_start_date(); ?></dd>

						<?php if (sp_get_start_date() !== sp_get_end_date() ) { ?>

							<dt><?php _e('End:', $sp_ecp->pluginDomain) ?></dt>

							<dd><?php echo sp_get_end_date();  ?></dd>						

						<?php } ?>

						<?php if ( sp_get_cost() ) : ?>

							<dt><?php _e('Cost:', $sp_ecp->pluginDomain) ?></dt>

							<dd><?php echo sp_get_cost(); ?></dd>

						<?php endif; ?>

						<?php sp_meta_event_cats(); ?>

					</dl>

					<dl class="column">

						<?php if(sp_get_venue()) : ?>

						<dt><?php _e('Venue:', $sp_ecp->pluginDomain) ?></dt> 

							<dd><?php echo sp_get_venue(); ?></dd>

						<?php endif; ?>

						<?php if(sp_get_phone()) : ?>

						<dt><?php _e('Phone:', $sp_ecp->pluginDomain) ?></dt> 

							<dd><?php echo sp_get_phone(); ?></dd>

						<?php endif; ?>

						<?php if( sp_address_exists( $post->ID ) ) : ?>

						<dt>

							<?php _e('Address:', $sp_ecp->pluginDomain) ?><br />

							<?php if( get_post_meta( $post->ID, '_EventShowMapLink', true ) == 'true' ) : ?>

								<a class="gmap" href="<?php sp_the_map_link() ?>" title="<?php _e('Click to view a Google Map', $sp_ecp->pluginDomain); ?>" target="_blank"><?php _e('Google Map', $sp_ecp-



>pluginDomain ); ?></a>

							<?php endif; ?>

						</dt>

							<dd>

							<?php sp_the_full_address( $post->ID ); ?>

							</dd>

						<?php endif; ?>

					</dl>

				</div>

				<?php if( get_post_meta( $post->ID, '_EventShowMap', true ) == 'true' ) : ?>

					<?php if( sp_address_exists( $post->ID ) ) sp_the_embedded_map(); ?>

				<?php endif; ?>

				<div class="entry">

					<?php the_content() ?>	

					<?php if (function_exists('sp_get_ticket_form')) { sp_get_ticket_form(); } ?>		

				</div>

				<a class="ical single" href="<?php echo sp_get_single_ical_link(); ?>"><?php _e('iCal Import', $sp_ecp->pluginDomain); ?></a>

				<a href="<?php echo sp_get_add_to_gcal_link() ?>" class="gcal-add" title="<?php _e('Add to Google Calendar', $sp_ecp->pluginDomain); ?>"><?php _e('+ Google Calendar', $sp_ecp->pluginDomain); ?></a>

				<?php edit_post_link('Edit', '<span class="edit-link">', '</span>'); ?>

			</div><!-- post -->



		<?php if(sp_get_option('showComments','no') == 'yes'){ comments_template();} ?>



	</div><!-- #content -->

	</div><!--#container-->



<?php get_sidebar(); ?>	

</div><?php /*Added by c_a_n_o_n */ ?>

<?php



	get_footer();

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This Micro Tutorial will demonstrate how marketers can use the Mobile Emulation Tool in Chrome Developer Tool. This will let you preview your site on any mobile device.
This Micro Tutorial will demonstrate using Google Doc how to import live data to another spreadsheet in Google Spreadsheets using the IMPORTRANGE function.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now