WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Function from function.php

[Resolved] Function from function.php

  • Hi !

    I try to call into a widget a function from function.php file. I call the function in a widget into the sidebar with this:

    <?php add_login_logout_link($items, $args); ?>

    My function from function .php is:

    <?php
    function add_login_logout_link($items, $args)
    {
      if(is_user_logged_in())
      {
        $newitems = $$items;
        $newitems .= '
                      <li><a class="button wc-forward" title="mon compte" href="/mon-compte/">Mon compte</a></li>
                      <li><a class="button wc-forward" title="se d├ęconnecter" href="'. wp_logout_url('index.php') .'">Se d├ęconnecter</a></li>';
      }
      else
      {
        $newitems = $items;
        $newitems .= '<li><a class="button wc-forward" title="Login" href="'. wp_login_url('/catalogue-investissement/') .'">Se connecter</a></li>';
      }
    
      return $newitems;
    }
    ?>

    Nothing is display this that. I try to use $GLOBALS[‘variablex’] but it doesn’t work.

    Thanks for your help. I keep trying to find !

    https://wordpress.org/plugins/php-code-widget/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Function from function.php’ is closed to new replies.