WordPress.org

Ready to get started?Download WordPress

Forums

Link category assignment in code (3 posts)

  1. esquivelp
    Member
    Posted 5 years ago #

    Hi:

    I have a section in my homepage that shows an "Important Links" section. Links that show up here are the ones that I add through wordpress interface (Write | Links). I am trying to do the same I did with the post section in which I just modify the category in the code

    [code]<?php $recent = new WP_Query("cat=32,33,34,35 &showposts=3"); while($recent->have_posts()) : $recent->the_post();?>[/code]

    and only those assign to that category will show up. I want to do the same thing with links so only links assigned to the category I specified in the code will show up in that section, however I can not figure it out. You can check my actual php for the link section I actually have. Thks!

    [code]<p>
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(4) ) : else : ?>
    <li id="links">

    <h2>Enlaces Importantes</h2>

      <?php get_links(-1, '

    • ', '
    • ', ' - '); ?>

    </div>
    </p>
    <div class="style27" style="padding-top:10px; border-top:1px dotted #C0C0C0; clear:both;"></div>
    <div class="style27" style="float:right; margin:0px 0px 5px 0px;">
    <p>[/code]

  2. esquivelp
    Member
    Posted 5 years ago #

    there is a section mispelled, correct one is:

    <?php get_links(-1, '

  3. ', '
  4. ', ' - '); ?>

  • esquivelp
    Member
    Posted 5 years ago #

    <?php get_links(-1, '<li>', '</li>', ' - '); ?>

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.