WordPress.org

Ready to get started?Download WordPress

Forums

Added align="left" to upload.php (2 posts)

  1. Pauls
    Member
    Posted 9 years ago #

    Been poking around in wordpress 1.2.2 trying to customize it to my specific needs and decided to slightly modify the upload.php file as follows. Hope someone else finds some value in this as well.

    $piece_of_code = "<img src=&quot;". get_settings('fileupload_url') ."/$img1_name&quot; alt=&quot;$imgdesc&quot; />";

    And I added the bolded bit below:

    $piece_of_code = "<img src=&quot;". get_settings('fileupload_url') ."/$img1_name&quot; alt=&quot;$imgdesc&quot; <strong>align=&quot;left&quot;</strong> />";

    Then, after uploading your image, you're presented with code like this that you can paste right into your post:

    <img src="http://yoursite.com/images/image.gif" alt="blah blah" align="left" />

    ...which saves you time in altering the img src tag right in your post every time you include a pic.

    Purpose? Well, when an image is linked to and positioned on your actual blog using the css "float" attribute, in some news aggregators after people subscribe to your RSS feed the image displays above the text of the post. Using align="left or right" hard coded into the img src tag causes the text to wrap around the image in the aggregator. Looks nicer that's all ;-)

  2. Pauls
    Member
    Posted 9 years ago #

    OOPS! First time I've posted code snippets here and the tags showed up. Please disregard them in the second code snip above, what's between them is what counts ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.