Home › Forums › Calendar Products › Events Calendar PRO › Don't show sidebar in Gridview
- This topic has 8 replies, 4 voices, and was last updated 10 years, 10 months ago by
Support Droid.
-
AuthorPosts
-
January 24, 2012 at 2:48 am #13937
Ruben
MemberI know, there are similar topics to this one. However, none of them helped me enough.
My problem is: On http://www.hanselmann-faessler.ch/termine/monat/ the calendar is showing fine. But if you switch to the next month (http://www.hanselmann-faessler.ch/termine/2012-02), there are more events and the calendar doesn’t fit on the page anymore. So, I would like to hide the sidebar. But only in Gridview, not for single event-pages.
Could anyone please give me the exact code and the place I got to enter it? I know a bit about adjusting themes and plugins but I’m not exactly an expert in PHP and HTML.
Thanks in advance, it’s kind of urgent.
January 24, 2012 at 11:20 am #13986Rob
MemberHey Ruben. No problem; I believe I understand what you’re trying to do. I can get our dev Jonah to take a look this afternoon & see if he has any suggestions to offer up here. Stay tuned.
January 24, 2012 at 10:20 pm #14054Jonah
ParticipantHi Ruben,
The solution for this is dependent on your theme and it is kind of complex. First off you’re going to want to modify your body classes so you can specifically target certain pages. You can try something along these lines but your theme might have a different body class filter in which case you’ll need to adjust. Try adding this to your themes functions.php file:
/*-----------------------------------------------------------------------------------*/
/* Adds new body classes for events pages
/*-----------------------------------------------------------------------------------*/
add_filter('body_class', 'add_browser_classes');
function add_browser_classes($classes){
if(tribe_is_event() && !tribe_is_day() && !is_single()) {
$classes[] = 'events-list';
}
if(tribe_is_month()) {
$classes[] = 'events-grid';
}
if(tribe_is_event() && !tribe_is_day() && is_single()) {
$classes[] = 'single-event';
}return $classes;
}
Once you’ve got that in place and working our task becomes much easier because then you can define specific CSS for each type of events page and modify the width of your main content area, hide the sidebar, etc…
So for instance on the calendar grid view you would use something like this in your CSS to change the layout:
.events-grid #content {
width: 770px;
}.events-grid #sidebar {
display: none;
}
Does that help?
January 29, 2012 at 8:23 am #14332Ruben
MemberDidn’t get it working. My functions.php looks like this:
<li id=”comment-“><div id="div-comment-“>
<?php echo get_avatar($comment,$size='36',$default='’ ); ?>
// <a class="date" href="#comment-” title=”Permanent Link to this comment”>comment_approved == ‘0’) : ?>
Your comment is awaiting moderation.‘div-comment’, ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’]))) ?>
<?php }
// end comment callback function (note: no need to close with )function create_archive() {
global $wpdb, $user_ID;
get_currentuserinfo();
$check = $wpdb->query(“SELECT * from $wpdb->posts WHERE post_title = ‘Archives'”);
if(!$check) {
$message = “Do not edit this page”;
$title_message = ‘Archives’;
$content = apply_filters(‘content_save_pre’, $message);
$post_title = apply_filters(‘title_save_pre’, $title_message);
$now = current_time(‘mysql’);
$now_gmt = current_time(‘mysql’, 1);
$post_author = $user_ID;
$id_result = $wpdb->get_row(“SHOW TABLE STATUS LIKE ‘$wpdb->posts'”);
$post_ID = $id_result->Auto_increment;
$post_name = sanitize_title($post_title, $post_ID);
$ping_status = get_option(‘default_ping_status’);
$comment_status = get_option(‘default_comment_status’);$postquery =”INSERT INTO $wpdb->posts
(ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, post_modified, post_modified_gmt, post_parent, menu_order)
VALUES
(‘$post_ID’, ‘$post_author’, ‘$now’, ‘$now_gmt’, ‘$content’, ‘$post_title’, ”, ‘static’, ‘$comment_status’, ‘$ping_status’, ”, ‘$post_name’, ”, ‘$now’, ‘$now_gmt’, ”, ”)”;
$result = $wpdb->query($postquery);
$metaquery = “INSERT INTO $wpdb->postmeta(meta_id, post_id, meta_key, meta_value) VALUES(”, ‘$post_ID’, ‘_wp_page_template’, ‘archives.php’)”;
$result2 = $wpdb->query($metaquery);
}
}function delete_archive() {
global $wpdb;
$check = $wpdb->query(“SELECT * from $wpdb->posts WHERE post_title = ‘Archives'”);
if($check) {
$burninate = $wpdb->query(“DELETE from $wpdb->posts WHERE post_title = ‘Archives’ and post_status = ‘static'”);
$result = $wpdb->query($burninate);
}
}function setup_archive() {
global $wpdb;if (file_exists(ABSPATH . ‘wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior-core.php’) && in_array(‘UltimateTagWarrior/ultimate-tag-warrior.php’, get_option(‘active_plugins’))) {
$menu_order=”chrono,tags,cats”;
} else {
$menu_order=”chrono,cats”;
}$initSettings = array(
// we always set the character set from the blog settings
‘newest_first’ => 0,
‘num_entries’ => 1,
‘num_entries_tagged’ => 0,
‘num_comments’ => 1,
‘fade’ => 1,
‘hide_pingbacks_and_trackbacks’ => 1,
‘use_default_style’ => 1,
‘paged_posts’ => 1,
‘selected_text’ => ”,
‘selected_class’ => ‘selected’,
‘comment_text’ => ‘%’,
‘number_text’ => ‘%’,
‘number_text_tagged’ => ‘(%)’,
‘closed_comment_text’ => ‘%’,
‘day_format’ => ‘jS’,
‘error_class’ => ‘alert’,
// allow truncating of titles
‘truncate_title_length’ => 0,
‘truncate_cat_length’ => 25,
‘truncate_title_text’ => ‘…’,
‘truncate_title_at_space’ => 1,
‘abbreviated_month’ => 1,
‘tag_soup_cut’ => 0,
‘tag_soup_X’ => 0,
// paged posts related stuff
‘paged_post_num’ => 15,
‘paged_post_next’ => ‘« previous 15 posts’,
‘paged_post_prev’ => ‘next 15 posts »’,
// default text for the tab buttons
‘menu_order’ => $menu_order,
‘menu_month’ => ‘Chronology’,
‘menu_cat’ => ‘Taxonomy’,
‘menu_tag’ => ‘Folksonomy’,
‘before_child’ => ‘ ‘,
‘after_child’ => ”,
‘loading_content’ => ”,
‘idle_content’ => ”,
‘excluded_categories’ => ‘0’);if (function_exists(‘af_ela_set_config’)) {
$ret = af_ela_set_config($initSettings);
}return $ret;
}// if we can’t find k2 installed lets go ahead and install all the options that run K2. This should run only one more time for all our existing users, then they will just be getting the upgrade function if it exists.
if (!get_option(‘k2installed’)) {
add_option(‘k2installed’, $current, ‘This options simply tells me if K2 has been installed before’, $autoload);
add_option(‘k2aboutblurp’, ‘This is the about text’, ‘Allows you to write a small blurp about you and your blog, which will be put on the frontpage’, $autoload);
add_option(‘k2asidescategory’, ‘0’, ‘A category which will be treated differently from other categories’, $autoload);
add_option(‘k2asidesposition’, ‘0’, ‘Whether to use inline or sidebar asides’, $autoload);
add_option(‘k2livesearch’, ‘live’, “If you don’t trust JavaScript and Ajax, you can turn off LiveSearch. Otherwise I suggest you leave it on”, $autoload); // (live & classic)
add_option(‘k2asidesnumber’, ‘3’, ‘The number of Asides to show in the Sidebar. Default is 3.’, $autoload);
add_option(‘k2widthtype’, ‘flexible’, “Determines whether to use flexible or fixed width.”, $autoload); // (flexible & fixed)
add_option(‘k2deliciousname’, ”, ‘Makes use of Alexander Malovs Delicious plugin to show the delicious links on the sidebar.’, $autoload);
add_option(‘k2archives’, ”, ‘Set whether K2 has a Live Archive page’, $autoload);
add_option(‘k2scheme’, ”, ‘Choose the Scheme you want K2 to use’, $autoload);
add_option(‘k2livecomments’, ‘0’, “If you don’t trust JavaScript and Ajax, you can turn off Live Commenting. Otherwise I suggest you leave it on”, $autoload);
}// Here we handle upgrading our users with new options and such. If k2installed is in the DB but the version they are running is lower than our current version, trigger this event.
elseif (get_option(‘k2installed’)
<input type="hidden" name="action" value="” />
<input name="deliciousname" style="width: 300px;" id="deliciousname" value="”>
Enter your delicious username here, to make use of Alexander Malov’s del.icio.us plugin<input name="archives" id="add-archive" type="checkbox" value="add_archive" />
Enabling this checkbox will create an Archives Page, which will show up in your blog menu as the first page.
<input type="submit" name="Submit" value=" »” />
Get help with Cutline at the Cutline support site.
And where do I put the second part? events.css of your plugin?
January 30, 2012 at 12:46 pm #14383Ruben
MemberIt is now kind of urgent as February is just around the corner. Would appreciate some further help. If it is easier to disable the sidebar in the calendar completely (not only gridview but also single events and so on), I would maybe switch to that solution.
January 30, 2012 at 1:27 pm #14384Jonah
ParticipantHey Ruben, can you paste this code @ http://pastebin.com/ – hard to read here…
You needed to add the first code to your functions.php file and the second CSS code would go into your events.css or style.css stylesheet files.
January 30, 2012 at 1:45 pm #14387Ruben
MemberHey Jonah
With help from a friend, I managed it. Here’s how:
I duplicated the theme’s page.php and renamed it to page_nosidebar.php. Inside the page_nosidebar.php I deleted the “php get sidebar”. I then told the plugin to use the nosidebar-theme.
Additionally, I set the position to relative and the width to 770px. Only problem: The footer is now just below the header. But fortunately, the footer is just behind the calendar-title.
January 31, 2012 at 9:13 am #14432Jonah
ParticipantGreat to hear, let us know if you need anything else with this.
– Jonah
July 3, 2015 at 5:00 pm #975458Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Don't show sidebar in Gridview’ is closed to new replies.
