Forums

Help embedding a template tag from a plugin (3 posts)

  1. osakamitsu
    Member
    Posted 9 months ago #

    Originally Posted in the wrong place, I think this is the correct place for this.

    Hello, I am very new to wordpress and webdesign in gerneral. I am VERY much in need of some help with installing this plugin. I've been all over google and I have read the read me but its over my head... There is alot of people on google who have the same problem, only I know what the problem is, just not how to fix it.

    The problem is the plugin called "user-submitted-posts", allows user to submit images to your blog. Well it doesnt actually post the images without using this template tag. From the read me file:

    To display the images attached to user-submitted posts, use this template tag:

    <?php post_attachments(); ?>

    This template tag prints the URLs for all post attachments and accepts the following paramters:

    <?php post_attachments($size, $beforeUrl, $afterUrl, $numberImages, $postId); ?>

    $size = image size as thumbnail, medium, large or full -> default = full
    $beforeUrl = text/markup displayed before the image URL -> default = <img src="
    $afterUrl = text/markup displayed after the image URL -> default = " />
    $numberImages = the number of images to display for each post -> default = false (display all)
    $postId = an optional post ID to use -> default = uses global post

    Additionally, the following template tag returns an array of URLs for the specified post image:

    <?php get_post_images(); ?>

    This tag returns a boolean value indicating whether the specified post is a public submission:

    <?php is_public_submission(); ?>

    Is there anyone out there that will give me help like I am slow? Telling me what line and where to paste it in? I dont see myself understanding it. My homepage is VERY simple and has almost nothing modified on it yet. And really im not even sure it goes on the homepage. The home page is where the posts are being posted with the needed image files that are not showing up.

    and if it makes a difference this is from the plugins site:

    Display image attachments for submitted posts

    This template tag displays the images attached to user-submitted posts:

    <?php post_attachments(); ?>
    The post_attachments template tag prints the URLs for the specified image attachments. It accepts the following parameters:

    <?php post_attachments($size, $beforeUrl, $afterUrl, $numberImages, $postId); ?>
    
    $size = image size as thumbnail, medium, large or full -> default = full
    $beforeUrl = text/markup displayed before the image URL -> default = <img src="
    $afterUrl = text/markup displayed after the image URL -> default = " />
    $numberImages = the number of images to display for each post -> default = false (display all)
    $postId = an optional post ID to use -> default = uses global post
  2. Sheree.Henley
    Member
    Posted 9 months ago #

    I'd like to know where to insert the code to enable displaying images too. Not an expert in coding and it's frustrating that developers of plugins write for other experts and not for beginners.

  3. osakamitsu
    Member
    Posted 9 months ago #

    well lets keep each other updated. If you figure it out let me know and if you do post back here. :D

    I've tried placing it on the various loop pages inside the areas that say start loop and end loop... I managed to get the pictures to show up but when they show up they take the place of the comments or I get errors on my form....No idea what to do.

    Really if I could just get confirmation on which page to place the template tag i might be able to figure it out.

    so... separate page holds the upload form... then the pics should show up in the comments section on the main page. Should this template tag be placed in the index.php within the loop? Or does it need to go on one of the actual loop pages? I have tried both but if I could pin point it I might be able to get lucky and get it working.

    It would be nice to get some information in uploading multiple images but I can settle with just one. Multiple seems a lot more involving with code.

Reply

You must log in to post.

About this Topic