WordPress.org

Ready to get started?Download WordPress

Forums

User Submitted Posts
[resolved] Still having issues getting a "template tag" or "custom field" for images (12 posts)

  1. thegoosenet
    Member
    Posted 1 year ago #

    I have tried again to do as the developer suggested. I included:
    <!--?php $images = usp_get_post_images(); foreach ($images as $image) { echo $image; } ?-->
    in The Loop.

    That is, this statement appears in the theme index.php file as follows

    <?php if ( have_posts() ) {

    <!--?php $images = usp_get_post_images(); foreach ($images as $image) { echo $image; } ?-->
    ...

    I still don't get anything in the post to link it to the image. The image uploads, but the post does not show a "template tag".

    http://wordpress.org/extend/plugins/user-submitted-posts/

  2. Allan Granier
    Member
    Posted 1 year ago #

    I don't know if this is the issue, but you have to remove the exclamation point and double-dashes so it's not a comment. As shown in your post the code is incorrect in this part:

    <!--?php

    You need to just write it like this:

    <?php

    and same for the end too:

    ?-->

    should be

    ?>

    I hope it helps you

  3. thegoosenet
    Member
    Posted 1 year ago #

    Ok, I changed it to look like this:

    <?php if ( have_posts() ) {

    <?php $images = usp_get_post_images(); foreach ($images as $image) { echo $image; } ?>
    ...

    Is the syntax now correct?

    It still isn't working.

  4. Allan Granier
    Member
    Posted 1 year ago #

    Hmm.. I don't know but the plugin is working fine on my site. I use the template tags included with the plugin to display the images in posts. I use this:

    <?php if (function_exists('usp_post_attachments')) usp_post_attachments(); ?>

    there are ways to customize in the readme file.

  5. thegoosenet
    Member
    Posted 1 year ago #

    See, maybe there is some basic thing I am not understanding.

    Exactly where did you put this statement? in the page that calls the [user-submitted-posts] or in The Loop? I tried putting it in the page, but that did not work.

    It's unfortunate that not all of us are familiar with and know how to use PHP code. I am not sure that it should be a prerequisite for using wordpress.org. This is the first time I have been truly stuck using a plugin.

  6. Allan Granier
    Member
    Posted 1 year ago #

    Sheesh, why not study a little PHP code and learn it then? Or maybe hire someone to help? Or find a different plugin? So many solutions but it's up to you to make it happen.

  7. Jeff Starr
    Member
    Plugin Author

    Posted 1 year ago #

    Hi thegoosenet, that code should be placed in the loop, for example single.php, index.php, etc. You don't need to learn PHP to use this plugin, but you should be familiar with theme files and copying/pasting template tags. For the next version, I will update the readme.txt with info about the prerequisites to using the plugin, along with further details on how to implement, display images, etc. Thanks for the feedback.

  8. thegoosenet
    Member
    Posted 1 year ago #

    Thank-you Jeff.

    As to your comment Allan--There is a steep learning curve to all programming languages. It's not how I want to spend my time. As far as finding another plugin, don't think I haven't looked. As far as I have been able to find out, this is the only game in town that does both--comments and pictures. Which is why I think Jeff should work on making it more user friendly.

  9. thegoosenet
    Member
    Posted 1 year ago #

    Okay, one step forward. I am looking at a test user post that I submitted. Under custom fields I see the URL for the image. I have also looked at the code you provide in your custom field tutorial. Finally, I have looked at your usp_get_post_images(), which is in The Loop on my site.

    As far as I can tell, usp_get_post_images() is mention to generate the code that looks like:

    ...

    This is the part that is not happening--that code is not being generated in the post.

    Is there something more that I should be doing?

  10. thegoosenet
    Member
    Posted 1 year ago #

    PS, it seems that when I sent the last email, the ... is resolving to the link.

    It should read "As far as I can tell, usp_get_post_images() is mention to generate the code that looks like: ..."

  11. slaidel
    Member
    Posted 1 year ago #

    <?php $images = usp_get_post_images(); foreach ($images as $image) { if (function_exists('usp_post_attachments')) usp_post_attachments(); } ?>

  12. Jeff Starr
    Member
    Plugin Author

    Posted 8 months ago #

    8 months later no activity.. gonna go ahead and close the thread. Please open a new thread if any further questions or concerns, thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.