Hi eMink,
It should still do so, it is hooked into the_content
to add the icons live. So the problem is probably in that particular page.
With the tabs and everything: I’m wondering how the page is generated. Are you using a plugin which generates the tabs ? If so, does that plugin respect the the_content
filter ?
It might be that just changing the priority on the filters will fix it.
I basically need more information to help.
Could you for instance try out adding one of the files to the first tab of the page to see if that makes a difference ?
Smile,
Juliette
Thread Starter
eMink
(@emink)
Thanks for replying jrf.
To your first question, yes. I am using a plugin called Visual Composer which is the one that generetes de tabs (among other things).
I believe you’re right. I think the problem is the tab page in general. I just created another page (without tabs) and the icons showed up.
What do you suggest I could do to fix this? I want to keep the tabs.
Best,
Oriol.
Thread Starter
eMink
(@emink)
I just remembered that I already have a page with tabs and the icons are showing up.
http://nou2014.cambramanresa.cat/cambra/normativa/
There might be a difference between having the links on the first tab (both working links) and later tabs (the non working one). That’s why I think changing the priority of the filters might solve it. However as Visual Composer is a commercial plugin, I don’t have access to their source code to give you advise on what to change it to.
You would basically need to find out on what priority their the_content
filter is run and then add a snippet along the lines of the below to your (child-)theme’s functions.php file:
function my_change_filter_prios() {
if( has_filter( 'the_content', array( $GLOBALS['mimetypes_link_icons'], 'mimetype_to_icon' ) !== false ) ) {
remove_filter( 'the_content', array( $GLOBALS['mimetypes_link_icons'], 'mimetype_to_icon' ), 15 );
add_filter( 'the_content', array( $GLOBALS['mimetypes_link_icons'], 'mimetype_to_icon' ), 99 ); // number has to be higher than the prio used by Visual Composer
}
}
add_action( 'init', 'my_change_filter_prios', 11 );
If you don’t mind not having the filesizes, you could alternatively change the MTLI async setting to ‘on’. That should still work.
Hope this helps.
Thread Starter
eMink
(@emink)
I’ll take a look tomorrow and I’ll try what you suggest or else I’ll just turn the MLTI async to ‘on’.
Thank you very much for your time!
You’re welcome! Please let me know whether either suggestion worked.
Just wondering if you ever had a change to test it…. π
Thread Starter
eMink
(@emink)
I just realised that the problem isn’t the tab. The problem is caused because of what’s inside the tab named ‘Notes de premsa’, which has a grid of posts. I am really interested in having the filesizes, so I’ll try what you suggested!
I am sorry for not replying before, but I didn’t have enough time to take a look at it!
Thread Starter
eMink
(@emink)
Hey there again!
The function that I think has the priority of the_content is here:
public function init() {
do_action( 'vc_before_init_base' );
// Add vc body classes
add_filter( 'body_class', array( &$this, 'bodyClass' ) ); // TODO: Check css to do.
add_filter( 'the_excerpt', array( &$this, 'excerptFilter' ) );
add_action( 'wp_head', array( &$this, 'addMetaData' ) );
add_filter( 'the_content', array( &$this, 'fixPContent' ), 11 ); //If weight is higher then 11 it doesn work... why? // TODO: remove from class create tools or smth else.
if ( is_admin() ) {
$this->initAdmin();
} else {
$this->initPage();
}
do_action( 'vc_after_init_base' );
}
The priority of mimetypes plugin is 15, if I am not mistaken, so it should be working even without that change in functions.php, but it isn’t.
I’ll keep looking at it.
No worries, I know what being busy is like π
What may help you figure out what plugin is adding what filter at what priority is the Debug Bar Actions & Filters plugin. You will need to install the Debug Bar first, then install the add-on.
Next go to the problem page -> click on the “Debug” button on the admin bar -> go to the Filters tab -> search for the ‘the_content’ filter.
You should then be able to see a list of the filters which work on the content and their priority.
Obviously you can de-activate the plugins once this issue is solved π
Hope that helps.
Thread Starter
eMink
(@emink)
Hey thanks for the feedback! I’ll try to do it now!
Thread Starter
eMink
(@emink)
Here you have the list of the filters.
the_content
Priority: 8
[object] WP_Embed -> run_shortcode
[object] WP_Embed -> autoembed
Priority: 10
wptexturize
convert_smilies
convert_chars
wpautop
shortcode_unautop
prepend_attachment
[object] Events_Maker_Shortcodes -> add_full_calendar
[object] bainternet_U_S_C -> User_specific_content_filter
Priority: 11
capital_P_dangit
do_shortcode
[object] WPBakeryVisualComposerSetup -> fixPContent
Priority: 15
[object] Mime_Types_Link_Icons -> mimetype_to_icon
As we can see the mimetype plugin has the higher priority. It should work, shouldn’t it?
It should… unless of course parts of the content are being replaced via javascript/AJAX call. If that’s the case, the only thing which will work is enable the AJAX functionality of MTLI (which will miss out on the file sizes).
Thread Starter
eMink
(@emink)
And I believe the content are being replaced via javascript as you said. Well, I’ll figure it out how to separate both things. The thing is that the problem is when there is a MTLI with a Grid Posts.
Thank you very much for your time! I’ll mark the this topic as resolved anway!