Title: Conditional php
Last modified: August 19, 2016

---

# Conditional php

 *  [betsyg](https://wordpress.org/support/users/betsyg/)
 * (@betsyg)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/conditional-php/)
 * I have tried this 100 different ways, but I can’t figure it out.
 * I am using a plugin called Post Links to post related links per page, and also
   to do them conditionally. Because it’s in the sidebar that’s already a nested
   list, I had to wrap part of it in an
    -  tag. The problem is that the blank li leaves a space if there is no list.
    - Here is the page [with the related links](http://thebetsygspot.com/about/thank-you).
      Here is the page [without the related links ](http://thebetsygspot.com/submissions).
      Here is the code, which I did not write so speak slowly:
    -     ```
          <?php  $args = array('format' => 'ul', 'div' => 'post-links', 'title' => 'Related links' ); ?>
                   <li><?php post_links($args); ?><li>
          ```
      
    - I’ve tried wrapping the
    -  around all kinds of things, get the look I want, but can’t get rid of the
      dang space when I do.
    - Thank you, brilliant people.

Viewing 1 replies (of 1 total)

 *  Thread Starter [betsyg](https://wordpress.org/support/users/betsyg/)
 * (@betsyg)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/conditional-php/#post-776192)
 * I hope someone will delete that. So sorry, let’s try again.
 * I have tried this 100 different ways, but I can’t figure it out.
 * I am using a plugin called Post Links to post related links per page, and also
   to do them conditionally. Because it’s in the sidebar that’s already a nested
   list, I had to wrap part of it in an li tag. The problem is that the blank li
   leaves a space if there is no list.
 * Here is the page [ with the related links. Here is the page ](http://thebetsygspot.com/about/thank-you)
   [without the related links](http://thebetsygspot.com/submissions). Here is the
   code, which I did not write so speak slowly:
 *     ```
       <?php  $args = array('format' => 'ul', 'div' => 'post-links', 'title' => 'Related links' ); ?>
                <li><?php post_links($args); ?><li>
       ```
   
 * I’ve tried wrapping the li tag around all kinds of things, get the look I want,
   but can’t get rid of the dang space when I do.
 * Thank you, brilliant people, and I hope I don’t mess up this post a second time.

Viewing 1 replies (of 1 total)

The topic ‘Conditional php’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)

 * 1 reply
 * 1 participant
 * Last reply from: [betsyg](https://wordpress.org/support/users/betsyg/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/conditional-php/#post-776192)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
