drbillylin
Forum Replies Created
-
Forum: Plugins
In reply to: [Multisite Language Switcher] Position of "This post is available in…"Works like a charm. Thanks realloc!
Forum: Plugins
In reply to: [Multisite Language Switcher] Position of "This post is available in…"Hi realloc,
I managed to achieve the desired result by changing the
function msls_content_filter( $content ) in MultisiteLanguageSwitcher.php to:/** * Filter for the_content() * * @package Msls * @uses MslsOptions * @uses MslsOutput * @param string $content * @return string */ function msls_content_filter( $content ) { if ( !is_front_page() && is_singular() ) { $options = MslsOptions::instance(); if ( $options->is_content_filter() ) { $obj = new MslsOutput(); $links = $obj->get( 1, true, true ); if ( !empty( $links ) ) { if ( count( $links ) > 1 ) { $last = array_pop( $links ); $links = sprintf( __( '%s and %s', 'msls' ), implode( ', ', $links ), $last ); } else { $links = $links[0]; } $content = '<p id="msls">' . sprintf( __( 'This post is also available in %s.', 'msls' ), $links ) . '</p>' . $content; } } } return $content; } add_filter( 'the_content', 'msls_content_filter' );
But it seems like I can’t override the function in a plugin in functions.php without modifying the plugin file (ie. commenting out your original function). If there’s a way to override it without changing your plugin file, then I can update your plugin without worrying… any hint there?
Forum: Plugins
In reply to: [Multisite Language Switcher] Position of "This post is available in…"I’ve played with the CSS (using position: absolute) and tried to hunt down the right php file where the multisite language link gets inserted, but haven’t found success…
Forum: Plugins
In reply to: [Multisite Language Switcher] Position of "This post is available in…"Hi realloc,
I have a similar question to Goodvalley, but I’m not sure if CSS is the right fix:Is there a way to move the “this post is available in…” link to the top of the post so that readers who cannot read the current language knows to switch over to the other language without scrolling down?
Interesting! I did add a new user to my English site, and after removing it, the problem is fixed.
Now I’m curious: is the issue with adding a user after the first-ever installation of this plugin? Because removing the plugin and redownload + reinstalling after the extra user is added does not fix the problem.
Since all the language switch data persists after removing the plugin, I guess it’s possible the problem persists as well.
Anyway, thanks for your help!
I should add a link to my site: https://www.drbillylin.com
First of all, thanks realloc for creating this great plugin and answering our questions so consistently.
I have the same problem. I was using multisite language switcher for and English version and a Chinese version of my blog without a problem before, but now I can only see two languages from the Chinese site. From the English site there is no trace of the Chinese site even existing.
In settings, from the English dashboard I can see:
Multisite Language Switcher Options
Doctor to Be / Englishwhile from the Chinese dashboard I can see:
Multisite Language Switcher Options
Doctor to Be / English | 醫學生筆記 / 中文Also very strangely, from my Chinese site I can see the widget link and the posts also have links to the English version, while they are absent from the English site.
I have tried uninstalling and reinstalling the plugin. I have tried switching to different themes including the official TwnetyTwelve and TwentyEleven themes. Neither seemed to work.
Any thoughts?