You can handle all these things with CSS. You could write something like this in your css-file:
p#msls { clear: left; padding: 1em; }
Cheers,
Dennis.
I thought something like that, but in the “Style.css” from my theme there is nothing like “msls”, so I don’t know where to put it.
I also tried with the “Style.css” from your plugin but it has no effect.
Sorry for the silly question, but I know nothing about css coding.
Simply add it to the style.css of your theme (or child theme).
I did it, but nothing happened. This is what I did first.
I writted in the “footer section”, like this:
#pagination a:hover, #pagination span.current {
background: #ccc;
p#msls { clear: left; padding: 1em; }
}
#pagination .page-numbers{
background-color: #FFFFFF;
border-right: 1px solid #EEEEEE;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
display: block;
float: left;
margin-right:3px;
padding: 4px 8px;
position: relative;
}
These are the last lines of my “Style.css”. I’m sure I’m doing something stupidly wrong, but I don’t know what it is
It can be necessary to flush the browser cache ([STRG] + F5).
This would be the correct css:
#pagination a:hover, #pagination span.current {
background: #ccc;
}
#pagination .page-numbers{
background-color: #FFFFFF;
border-right: 1px solid #EEEEEE;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
display: block;
float: left;
margin-right:3px;
padding: 4px 8px;
position: relative;
}
p#msls { clear: left; padding: 1em; }
Yes, I did it, again and again. Nothing.
No, wait!
It’s ok, I didn’t see your last post
Works perfectly
Thank you very much, awesome!
Very good. You’re welcome.
Cheers,
Dennis.
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?
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…
In the current version it is just possible with some lines of PHP in the functions.php. Would this be a problem for you?
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?
You could remove my filter and then add yours.
remove_filter( 'the_content', 'msls_content_filter' );
add_filter( 'the_content', 'my_msls_content_filter' );
function my_msls_content_filter() {
...
}
Works like a charm. Thanks realloc!