• Resolved girl_number_5

    (@trutherone)


    Hi,

    I’m customising the default login page and want to replace the ‘|’ (pipe character) inbetween the ‘register’ link and ‘forgot password’ link. Id like to replace it with a line-break so that the two links appear on sperate lines. Ive tried text.replace() in jQuery and replace() in php in functions.php in my child theme but it just outputs the break (<br />) as a string literal (without quotes around the break it just ignores the line-break). Im also aware that the ‘pipe’ char if comparing using regex is a reserve character meaning A|B (A or B) so i’ve tried a literal string and escaped string regex style. The html shows the pipe char as a string literal ” | ” between the two <a> links i.e.

    <a>register</a>
    " | "
    <a>forgot password</a>

    all 3 are enclosed in a parent paragraph with an id of nav (#nav) so im using this as the target for my jQuery find/ replace funcs. Its seems crazy but it just wont get the ‘pipe’ char.

    Note: for anyone testing this out the pipe only appears when you have ‘anyone can register’ option turned on in WP admin settings.

    Any ideas anyone please???

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anton Vlasenko

    (@antonvlasenko)

    Do you see any errors in your browser’s console ?

    I’ve just tried this dummy code and replacing | with <br> works.

    You can refer to the example here: https://codepen.io/antonvlsnk/pen/OJevwmE

    Thread Starter girl_number_5

    (@trutherone)

    Hi Anton,,

    i figured it out earlier this morning but wasn’t able to get onto these forums getting a ‘bad gateway too many requests error in Chrome’. But that’s what worked – initially i was using text.replace() and it only occurred to me later that we’re searching for and replacing html.

    Thanks for your answer anyway.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.