• Hi Woody team!

    I’m trying to put together a universal snippet with PHP and CSS to customize the WP login page. How do would edit the echo line to pull in or reflect the css within this snippet? or do i have to create a separate snippet for each? code below

    Thanks in advance!

    /**
    * Custom login page
    */
    function my_custom_login()
    {
    echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . get_bloginfo(‘stylesheet_directory’) . ‘/style.css” />’;
    }
    add_action(‘login_head’, ‘my_custom_login’);

    add_filter( ‘login_headerurl’, ‘my_custom_login_url’ );
    function my_custom_login_url($url) {
    return ‘https://trainingdemo.nmg-services.online/&#8217;;
    }
    /* Custom login page */
    #login h1 a {
    background-image: url(“https://trainingdemo.nmg-services.online/wp-content/uploads/2020/04/2019_8_4_NMG_logo_whiteouline.png&#8221;);
    background-size: 200px 84px;
    width: 200px;
    height: 84px;
    }

    • This topic was modified 4 years, 7 months ago by 4Mulator ??.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Temyk

    (@webtemyk)

    Hello

    If I understand you correctly, this is it

    /**
    * Custom login page
    */
    function my_custom_login()
    {
      ?>
      <style>
      /* Custom login page */
    #login h1 a {
    background-image: url(“https://trainingdemo.nmg-services.online/wp-content/uploads/2020/04/2019_8_4_NMG_logo_whiteouline.png”);
    background-size: 200px 84px;
    width: 200px;
    height: 84px;
    }
      </style
      <?php
    }
    add_action('login_head', 'my_custom_login');
    Thread Starter 4Mulator ??

    (@4mulator)

    Hi Artem

    thank you so much for your reply! yes, this is what i mean, combining css with the php. i just couldn’t figure out how to say it until i saw the code.

    i did try placing it in but unfortunately, it did not work…any ideas as to how else this can be done?

    Thank you again!

    Plugin Support Temyk

    (@webtemyk)

    /**
    * Custom login page
    */
    function my_custom_login()
    {
      ?>
      <style>
      /* Custom login page */
    #login h1 a {
    background-image: url(“https://trainingdemo.nmg-services.online/wp-content/uploads/2020/04/2019_8_4_NMG_logo_whiteouline.png”);
    background-size: 200px 84px;
    width: 200px;
    height: 84px;
    }
      </style>
      <?php
    }
    add_action('login_head', 'my_custom_login');
    Thread Starter 4Mulator ??

    (@4mulator)

    Hi Artem,

    Thank you again, when i try that code, i get this message:

    Don’t Panic

    The code snippet you are trying to save produced a fatal error on line 0:
    Exception thrown without a stack frame

    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.

    Plugin Support Temyk

    (@webtemyk)

    I sent you the working code. Check your code for errors

    Thread Starter 4Mulator ??

    (@4mulator)

    Hi Artem,

    I’m not sure what i can be doing incorrectly. I record a 20 second screencapture here: https://www.dropbox.com/s/cqmnjyplmxttwth/Screen%20Recording%202020-04-16%20at%2010.12.04%20PM.mov?dl=0

    please let me know

    Plugin Support Temyk

    (@webtemyk)

    If you use a universal snippet, add <?php at the beginning of the code.
    You don’t need to do this in the PHP snippet, where the opening tag is inserted automatically in the editor.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Call out in Universal Snippet’ is closed to new replies.