• I have managed to integrate the plugin and now i has noticed a bug… if i have received this (<? php if (function_exists (‘ coauthors_posts_links’) {)
    coauthors_posts_links ();
    } else {
    the_author_posts_link ();
    }?>

    ) and Add 2 authors to a post, there are missing the gaps between the author’s name and the word “and”.

    see attachment

    -> https://cl.ly/oNcw

    thx

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Had the same problem on our side, just with the German word “und”. Added this small script in footer.php of the child-theme:

    <script type="text/javascript">
        <!-- SCRIPT FOR BUGFIX IN CO-AUTHORS PLUS: REPLACE "und" with " und " IN MULTIPLE EDITORS INFORMATION  -->
    	<!-- PROBLEM ONLY EXIST IN GERMAN -->
        jQuery('.post-time').each(function() {
    		if (jQuery('.post-time:contains("</a>und<a")')) {
    			jQuery('.post-time .author.url.fn:nth-last-child(3)').after(" ");
    			jQuery('.author.url.fn:last').before(" ");
            }
        });
    </script>
    

    Not really elegant but it works.

    Thread Starter joshuasch

    (@joshuasch)

    Danke für deine Antwort!

    Wir habne auch in Deutshc mit und das Problem.. war mir nur nicht sicher ob es hier verstanden wird…

    Wir benutzen das independent-publisher theme und dort klappt es mit der footer php leider nicht =(

    Gibt es denn eine Beispielseite, auf der das Problem auftritt? Dann k?nnte ich es mir anschauen und das jQuery evtl. anpassen.

    Thread Starter joshuasch

    (@joshuasch)

    Hey,
    danke für deine Antwort ??
    ja gibt es und zwar hier z.B.

    -> https://trommel-bass.de/fetenreporterin-berlin-jule-lola-rennt/

    danke!! <3

    So try this script:

    jQuery('.entry-content').each(function() {
    		if (jQuery('.entry-content:contains("</a>und<a")')) {
    			jQuery('.entry-content .author.url.fn:nth-last-child(4)').after(" ");
    			jQuery('.entry-content .author.url.fn:nth-last-child(3)').before(" ");
            }
        });

    It is not beautiful but a working hack.

    Thread Starter joshuasch

    (@joshuasch)

    Ohh sweet! you are the best! it’s working! ??

    sublines

    (@sublines)

    I know this question is old but the solution to this problem was terrible so I want to offer a new one. Using jquery to manipulate the dom is a dirty fix and not everyone will want to use javascript at all.

    First of all, this wont work with posts that have more than three authors.
    Second, the solution posted above will ad a whitespace every single time the script finds the word “und” anywhere on the page.

    A much cleaner solution would be to use css. This will work across browsers and in all languages.

    a.author.url.fn:before,
    a.author.url.fn:nth-last-child(2):after {
        content: " ";
    }

    This code adds a whitespace character before every author name and a whitespace character before the word “and” (or whichever translation of it you use) like so:
    Name1,Name2andName3
    -> becomes ->
    Name1, Name2 and Name3

    The added whitespace character before the first name gets omitted by the browser automatically.

    • This reply was modified 7 years ago by sublines.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bug’ is closed to new replies.