Forum Replies Created
-
AuthorPosts
-
October 10, 2018 at 10:36 am in reply to: CSS problems after migration from sub-domain to root #1019865
All good – you can close this one!
October 9, 2018 at 9:31 pm in reply to: CSS problems after migration from sub-domain to root #1019670Hi Nikko,
I fixed the problem. For some reason the WordPress Options table in the database still had the sub-domain listed as siteurl and home, even though I had changed those via the WordPress dashboard. The strange thing is that Find and Replace operations on the database also failed to find them – I only found them when poking about manually in the database with PHPmyadmin.
Thanks for pointing me in the right direction.
Eoghan
October 8, 2018 at 11:15 am in reply to: CSS problems after migration from sub-domain to root #1018919Hi Nikko,
I’m not using any caching plugin. When you say the site is “still pointing on your subdomain”, do you mean that you’re seeing the site as loading from new.p4ne.org? How do you see that? I can only see that the CSS is coming from that domain.
If I sign into the dashboard at the root domain and edit something, the edit appears on the site too.
Eoghan
October 6, 2018 at 11:07 am in reply to: CSS problems after migration from sub-domain to root #1018471Thanks for the suggestion Rikard.
The dynamic_avia folder was in the new directory already. But just to test your theory, I deleted it, then changed something in the theme options and saw that it was indeed re-generated. However, loading the site in a fresh browser shows that it’s still loading CSS from the sub-domain (new.p4ne.org).
Note that it’s using an Enfold child theme (titled P4NE).
Eoghan
March 4, 2018 at 4:50 pm in reply to: Conflict between Enfold 4.2.2 and Events Calendar PRO 4.4.22 #921087I don’t know whether it’s the same bug or not, but something has been logged with Modern Tribe/The Events Calendar. See:
https://theeventscalendar.com/support/forums/topic/conflict-between-enfold-4-2-2-and-events-calendar-pro-4-4-22/#post-1468757Hi Ismael,
I had not tried the code you suggested as it seemed to me that it would not deliver what I am looking for. I have now tried it and indeed found that to be case.
In the secondary blog that uses only one category (97, ‘Collaboration by Design’; here: https://brightgreenlearning.com/academy/collaboration-by-design) it works fine, with the page navigation limited to that specific category. (The posts in that blog don’t belong to any other category.
However, in the primary blog ( https://brightgreenlearning.com/blog) posts have multiple categories. The code you suggested (which I have left in place in functions.php for now) therefore means the page navigation jumps to the next post which shares one category with the current post, rather than the next oldest or newest post.
Is there some way of having that code apply only to the first of those two blog loops, but not to the primary, multi-category blog?Thanks,
EoghanHi Ismael,
Thanks for helping with this. Maybe it’s best if I explain from the start, but in brief:
– There’s a blog on the website, using multiple categories, here: https://brightgreenlearning.com/blog
– There’s also a blog, but using only one category (97, ‘Collaboration by Design’), here: https://brightgreenlearning.com/academy/collaboration-by-design
– I would like both the main blog (multiple catgories) and the single-category blog to be entirely separate from the visitors point of view. So I have managed, for example, to have a different sidebar show up on posts that are in category 97 and also to have that category hidden from the sidebar categories widget that appears on the main blog.What I have not been able to do is to stop the post navigation at the edges of the screen from A) excluding category 97 when browsing the main blog and B) showing only category 97 when browsing the alternative blog?
I could potentially solve this by just disabling that navigation option altogether, but it does add some value for site visitors, so I’d rather keep it there.
@John Torvik tried helping me above, but the proposed solutions have not worked.If you have any suggestions I’d be most grateful.
Thanks,
EoghanHi John,
Thanks for your continued help with this. I’m afraid the code above is not working either. I have tried using just your code, and also that code with the filter added (in case that was having an impact on where it was called) as follows:
function exclude_category($query) { if ( $query->is_feed ) { $query->set('cat', '-97'); } if ( $query->is_singular(‘post’) && $query->is_main_query() ) { $query->set( 'cat', '-97' ); } return $query; } add_filter('pre_get_posts', 'exclude_category');
To be clear, while the “Collaboration by Design” category (97) no longer appears in the dropdown menu in the Categories widget, it is still being called when navigating through the blog using the next and previous post buttons. For example, on this page:
…the previous post is one from Category 97.
I’m wondering whether I need to be specifying that my exclusion request applies to the avia-post-prev (and -next) situations?
Sign-in details in the private box…
Thanks,
EoghanThanks John.
As it won’t let me redeclare “exclude_category”, which I’ve already declared in the is_feed above, can you tell me what the syntax is for adding this is_singular snippet to the code. Is it something like this?
function exclude_category($query) { if ( $query->is_feed ) { $query->set('cat', '-97'); } return $query; } add_filter('pre_get_posts', 'exclude_category'); if ( $query->is_singular(‘post’) && $query->is_main_query() ) { $query->set( 'cat', '-97' ); } } add_action( 'pre_get_posts', 'exclude_category' );
(I know what I’ve pasted above does not work, but I’m not sure how to fix it.)
Thank you again,
EoghanThanks so much John. That’s worked perfectly.
Can I tack on a follow-on question, not unrelated?
I’ve now hidden category ID 97 (“Collaboration by Design”) from both the dropdown and from the Masonary blog view that appears on the blog homepage. However, if I click on this post:
…the left-hand pager arrow that allows me to jump to the previous blogpost jumps to a post that is in category 97:
I can’t work out how to also exclude that category from appearing at all when clicking through the posts in that way.
(I the code below in functions.php to exclude the posts from my RSS feed, which is picked up by a MailChimp campaign:)/* Excluding the Collaboration By Design category from the RSS feed so it doesn't get picked up by MailChimp */ function exclude_category($query) { if ( $query->is_feed ) { $query->set('cat', '-97'); } return $query; } add_filter('pre_get_posts', 'exclude_category');
Thanks in advance.
EoghanWith huge thanks to @crawford13, plus a little extra investigating on my part this evening, I finally got this working.
To help others, if you want to add a sub-menu on event calendar pages, you need to do the following:
1. Add this code to your functions.php
add_action('after_setup_theme', function() { if(is_child_theme()) remove_action('tribe_events_template', 'avia_events_tempalte_paths', 10, 2); }); add_action('tribe_events_template', 'avia_events_template_paths_mod', 10, 2); function avia_events_template_paths_mod($file, $template) { $redirect = array('default-template.php', 'single-event.php'); if(in_array($template, $redirect)) { $file = get_stylesheet_directory() . "/config-events-calendar/views/".$template; } return $file; }
Note that even though I’m only modifying the default-template.php file below, I still included single-event.php in the redirect array here:
$redirect = array('default-template.php', 'single-event.php');
2. In /wp-content/themes/enfold/config-events-calendar/views find default-template.php and create a local copy.
Edit it as follows, adding the do_shortcode for the submenu, wrapped in php tags, just above <div class=’container_wrap container_wrap_first main_color fullsize’>
<!-- Add subnav --> <?php echo do_shortcode("[av_submenu which_menu='' menu='96' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled'] [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style=''] [/av_submenu]"); ?> <div class='container_wrap container_wrap_first main_color fullsize'>
That’s what worked for me.
Thanks again to @Ismael, @Yigit and – in particular – @crawford13
Sure! I’m a trusting kind of guy!
The details are on their way.
Thanks,
EoghanContinued thanks @crawford13. I had not realized that I should be using templates provided by Enfold. (I forgot that Enfold is specifically configured to be compatible with these plugins.)
So, I now have a functions.php in my child theme that includes (among other snippets that are all working properly) the following:
/* Telling the Event Calendar plugin to use the view templates found in the Child Theme */ add_action('tribe_events_template', 'avia_events_template_paths_mod', 10, 2); function avia_events_template_paths_mod($file, $template) { $redirect = array('default-template.php', 'single-event.php'); if(in_array($template, $redirect)) { $file = get_stylesheet_directory() . "/config-events-calendar/views/".$template; } return $file; }
And I have the default-template.php file sitting in /wp-content/themes/enfold-child/config-events-calendar/views and looking like this:
<?php global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $title = tribe_is_month() ? __('Calendar of Events', 'avia_framework') : tribe_get_events_title(false); $args = array('title'=> $title, 'link'=>''); if( !is_singular() || get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title($args); do_action( 'ava_after_main_title' ); ?> <?php echo do_shortcode("[av_submenu which_menu='center' menu='' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [/av_submenu]"); ?> <div class='container_wrap container_wrap_first main_color fullsize'> <div class='container'> <main class='template-page template-event-page content av-content-full units' <?php avia_markup_helper(array('context' => 'content','post_type'=>'page'));?>> <div id="tribe-events-pg-template"> <?php tribe_events_before_html(); tribe_get_view(); tribe_events_after_html(); ?> </div> <!-- #tribe-events-pg-template --> <!--end content--> </main> </div><!--end container--> </div><!-- close default .container_wrap element --> <?php get_footer(); ?>
But still the sub-menu in question appears on neither of the following pages:
https://brightgreenlearning.com/coursesThis is the sub-menu I’m trying to have appear on those pages:
Perhaps you could take one final look at the above and see if you can spot what I’m doing wrong or what’s going wrong.
Thank you so much,
Eoghan
(@thatcommsguy)Thank you so much @crawford13. It is indeed very kind of you to jump in here.
Sadly I’ve still not managed to get it working, despite having followed (or tried to follow) your steps.
One possible clue to where this is going wrong is that my default-template.php file doesn’t seem to be the same as yours. Here’s the complete contents of my file (before adding any shortcode):
<?php /** * Default Events Template * This file is the basic wrapper template for all the views if 'Default Events Template' * is selected in Events -> Settings -> Template -> Events Template. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/default-template.php * * @package TribeEventsCalendar * */ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } get_header(); ?> <div id="tribe-events-pg-template"> <?php tribe_events_before_html(); ?> <?php tribe_get_view(); ?> <?php tribe_events_after_html(); ?> </div> <!-- #tribe-events-pg-template --> <?php get_footer();
Any idea why this is different? Is it because I’m not on their PRO version? (I have Tickets Plus, but the free calendar.)
And any idea where I might try inserting the do_shortcode here?
It’s also still unclear to me whether or not I should be wrapping the shortcode in php tags when I do insert it. Your example above doesn’t wrap it (from what I can see).
Thanks. I’m really keen to get this solved.
Eoghan
@thatcommsguyHi Ismael,
Sorry if I’m coming across as incompetent here. I’m just not managing to get this to work. (Perhaps I should be getting support from Modern Tribe in this case?)
Can you confirm the following (at least for single event listings):
1. I need to edit the file single-event.php and copy it to /wp-content/themes/enfold-child/tribe-events, which will cause the plugin to use that file rather than the default
2. I only need to add the shortcode snippet below to that page,echo do_shortcode("[av_submenu which_menu='center' menu='' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [/av_submenu]");
…underneath the following container:
<div id="tribe-events-content" class="tribe-events-single vevent hentry"> <p class="tribe-events-back"><a href="<?php echo tribe_get_events_link() ?>"> <?php _e( '« All Events', 'avia_framework' ) ?></a></p>
…and wrapped in php tags as follows
<?php [snippet] ?>
3. Do I need to add anything to the original snippet you provided (e.g. the name of the sub-menu, any additional menu items that I’ve since added, etc…?
4. Do I need to add any other code to the single-event.php file or to any other file to make this work?
I’ve tried changing the single-event.php file in other ways and uploading it, just to see whether that is indeed the file that’s being used for a page like this: https://brightgreenlearning.com/course/fundamentals-of-collaboration-by-design-core-module
But I haven’t succeeded.Again, sorry for not managing to follow your instructions properly. The Enfold support is really great and I generally can get everything to work first time…I’ve just hit a wall on this one.
Thanks,
EoghanThanks Ismael.
I understand that I need to edit the templates (and will add them within my child theme to avoid them beîng overwritten when there are updates). But I’m not sure where in the templates I should be added the do_shortcode snippet. I’ve tried adding it in a couple of different places in the single-event.php template but without any effect.
Any further guidance you can offer would be most welcome.
Eoghan
(thatcommsguy)January 13, 2017 at 5:44 pm in reply to: Special amp color fix not working in Alternate Content Special Heading #733245Thanks Yigit.
If I look at this page: https://brightgreenlearning.com/academy/pricing-packages I just see a standard ampersand, which is of course fine. But it would be nice to use the enfold special ampersand, as long as it’s in white in that section.
I had added some code to the custom CSS to try to do that – if found it elsewhere in the Enfold forums – but it wasn’t working.
It’s not a big deal – the ordinary ampersand is fine.
Eoghan
January 13, 2017 at 5:13 pm in reply to: Special amp color fix not working in Alternate Content Special Heading #733219Sure…. Here you go:
January 13, 2017 at 5:07 pm in reply to: Special amp color fix not working in Alternate Content Special Heading #733215Hi Yigit,
I’m afraid not! That’s a standard ampersand, which I could place there with the html code, rather than the special ampersand that Enfold kindly makes available for us. It’s not a big deal, although if I edit that page I have to remember to re-add the html code again as it recoverts it to a plain text ampersand which then is not visible on the page.
So if you have a solution that would make the special ampersand appear, it would be most welcome!
Thanks,
EoghanThat’s great Nikko. Many thanks!
Many thanks Ismael. That worked perfectly.
I have one more related question, if you don’t mind: is there an is_ function that I can use to do the same thing on the calendar page from the Event Calendar (https://brightgreenlearning.com/courses or https://brightgreenlearning.com/course)?
It doesn’t work if I simply add them to the is_page array, as I guess they’re not actually pages.
Thanks…
Eoghan -
AuthorPosts