Simple PHP help

Discussion in 'PHP' started by jluyt, Jul 31, 2007.

  1. #1
    I am not too webb versed with PHP and want to RIGHT ALLIGN the image in the line of PHP code below:
    <?php
    wp_list_cats('feed_image=http://www.domain.info/images/feed.gif&feed=XML  Feed&optioncount=2&children=0'); ?>
    PHP:
    How should it look?

    All help will be greatly appreciated
    Justin
     
    jluyt, Jul 31, 2007 IP
  2. Sohan

    Sohan Peon

    Messages:
    2,330
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    0
    #2
    wp_list_cats() does not look like a valid function unless it's your own?

    Cant you just wrap it in <div align="right"></div> ??
     
    Sohan, Jul 31, 2007 IP
  3. chikabc

    chikabc Peon

    Messages:
    19
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    from what i understand, your problem is html/xhtml/css instead of php.

    But if your code returns an image file to the browser, enclose it with the <img /> (onless you are sending this: herder("Content-Type: image/gif"); ) and use the align property to align the image thus:

    <img src="img/5_p1.jpg" width="166" height="121" align="right" />

    Let us know if this helps
     
    chikabc, Jul 31, 2007 IP
  4. jluyt

    jluyt Peon

    Messages:
    129
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for trying to help me... I really need help. Here is the full PHP code... I still do not know where to put the allignment:

    <li id="Categories">
    	<h2>Article Categories</h2>
    		<ul>
    		<?php wp_list_cats('feed_image=http://www.txlocal.info/images/feed.gif&feed=XML Feed&optioncount=2&children=0'); ?>
    		</ul>
    	</li>
    PHP:
     
    jluyt, Jul 31, 2007 IP
  5. chikabc

    chikabc Peon

    Messages:
    19
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK let us see the output of this code so that we can know where the image is
     
    chikabc, Aug 1, 2007 IP
  6. jluyt

    jluyt Peon

    Messages:
    129
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    see attached
     

    Attached Files:

    jluyt, Aug 1, 2007 IP
  7. chikabc

    chikabc Peon

    Messages:
    19
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok. what i wanted was the html output

    The best thing to do in this case is to dig into the "wp_list_cats()" function, find who is reponsible for outputing the html that includes the image. This should contain <img /> tag, align it to the left thus:

    Lazy Method is to do this at the head of your html page:
    <style type="text/css">
    li img{
    float: right;
    }

    li{
    clear: both;
    }
    </style>

    I call this a lazy method because it's simple but could cause other problems which will be difficault to sort if you don't know css

    Finally,
    if you post this function, wp_list_cats(), somebody will sort it for you widthin a second

    good luck
     
    chikabc, Aug 1, 2007 IP