WordPress.org

Ready to get started?Download WordPress

Forums

Making a Post Templat with an image (3 posts)

  1. jagaur
    Member
    Posted 6 years ago #

    I am attempting to create a Post Template for my site, where an image appears in each post. According to what I have found so far(from this help site) I need to edit the file edit-form-advanced.php and insert the following code:

    <?php
    if (empty($post->post_content)) {
    $post->post_content = "Your Text or Code goes Here" ;
    }
    ?>

    above the line

    <?php the_editor($post->post_content); ?>

    This sounds wonderful, but what code do I put in the area marked Your Text or Code goes Hereto show the following image in each post?

    img src="http://www.exoticise.net/wp-content/uploads/2007/12/furryshoes200x133.jpg" align="right" width="100" height="66"

    So far I have

    <?php
    if (empty($post->post_content)) {
    $post->post_content = "img src=http://www.exoticise.net/wp-content/uploads/2007/12/furryshoes200x133.jpg" align="right" width="100" height="66">" ;
    }
    ?>
    <?php the_editor($post->post_content); ?>

    and I keep getting the error

    Parse error: syntax error, unexpected T_STRING in /home/theno3/public_html/teach/wp-admin/edit-form-advanced.php on line 156

    my template is Mandigo, WP version is 2.31 and my site is teach.exoticise.net it is in development so if you want to see a sample post visit this link I want the image to appear in the upper right-hand corner of each post like it does in my page template (see example)

    Thank you!

  2. btp
    Member
    Posted 6 years ago #

    Dude, you're on the right track, but check the formatting of the html you're trying to insert-- missing open bracket, non-matching double quotes! Check out what worked for me:

    <?php
    if (empty($post->post_content)) {
    $post->post_content = "<img src='http://www.exoticise.net/wp-content/uploads/2007/12/furryshoes200x133.jpg' align='right' width='100' height='66'>" ;
    }
    ?>

  3. 272763386
    Member
    Posted 6 years ago #

    thanks ,I have the same problem

Topic Closed

This topic has been closed to new replies.

About this Topic