• Resolved saftogvann

    (@saftogvann)


    I’ve created an aouthors template that works. Now I want to list the authors favourite links in the sidebar. I thought this would work, but it doesn’t.

    I’ve created a links category named the same as authors loginname.

    <h5>Favourites of <?php echo $curauth->user_firstname; ?></h5>
    <ul>
    <?php wp_get_linksbyname('<?php echo $curauth->user_login; ?>') ?>
    </ul>

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php wp_get_linksbyname("$curauth->user_login"); ?>

    Some PHP basics:

    1. Do not nest PHP tags. i.e. <?php <?php …

    2. You do not echo or print a variable as an argument to a function. Simply pass the variable (as shown above).

    Thread Starter saftogvann

    (@saftogvann)

    Thanks a lot – as you quite easily detected: I’m no programmer.

    Works as intended now!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List authors favourite links’ is closed to new replies.