[resolved] Wrapping text around links (5 posts)

  1. jimmyt1988
    Posted 6 years ago #

    Hi all,

    I tried yesterday to figure this out. In fact I spent 2 hours on it.

    When outputting links:

    $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0');
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    <?php echo $children; ?>
    <?php } ?>

    I want to add divs around the individual links:

    <div style = "1"><div style = "a"><ul><li>link1</li></ul></div></div>
    <div style = "2"><div style = "b"><ul><li>link2</li></ul></div></div>
    <div style = "3"><div style = "c"><ul><li>link3</li></ul></div></div>

    How the diddly do I do this. *wipes sweat from forehead*

  2. jimmyt1988
    Posted 6 years ago #

    Oh please someone help. I am desperate. I'm now trying to jquery stuff in :(

  3. jimmyt1988
    Posted 6 years ago #

    <li> THIS IS A LINK </li>

    I need each link that is output to have a surrounding <div> tag like this:

    <div><li> THIS IS A LINK </li></div>
  4. Michael
    Forum Moderator
    Posted 6 years ago #

    you probably didn't get any help because your idea leads to invalid html.

    if you could describe what you are trying to achieve, you might get more help.

    general, you could work with 'str_replace()'

  5. jimmyt1988
    Posted 6 years ago #

    Thanks for your help. I ended up adding stuff with jquery. Not as sexy as I'd hoped to make it but good enough for now. Thanks for your response :D

Topic Closed

This topic has been closed to new replies.

About this Topic