• Resolved liujunjie688

    (@liujunjie688)


    Hi,
    Thank you for ACFRPW. It has mostly contained all the features I was hoping for.
    Unfortunately I am stuck trying to display images from my posts. The posts do not actually contain uploaded/attached images. Rather, the posts contain html img src tags. When I view my posts I can see images, but the images are not shown in my pages after using ACFRPW widget. Is there a way to have the html img tag display in my pages at top of the posts? Note that not all posts will contain img src tags. I am trying to automate some of my blogging posts, so downloading the images and setting as a featured image is not feasible. Note this has been possible using other widget, but it had other numerous drawbacks. So I hope this can be possible with ACFRPW.
    Thanks in advance for your support!
    Kind regards,
    Sean

    https://wordpress.org/plugins/acf-recent-posts-widget/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Rafał Gicgier

    (@gicolek)

    Hello liujunjie688,

    Is the HTML tag a part of WordPress content editor?

    The plugin comes with a set of predefined templates that may be easily overwritten. My plugin by default displays the excerpt, which to the best of my knowledge ignore the HTML tags.

    Hence what you will need to do is:

    1. Make a copy of the loop-* files from the /templates directory of the plugin.
    2. Put these copies inside your active theme, under /acfrpw directory.
    3. Edit one of the files to achieve the expected. My bet is that you will need to change the_excerpt with the_content in loop-inner.php

    Let me know if that sorted out the problem and get back with a reply 😉

    Regards & have a nice weekend!

    Thread Starter liujunjie688

    (@liujunjie688)

    Thanks for quick reply! Really appreciated!!

    I made the changes. I can now see the image on my page. However, now the Excerpt Length is being ignored. I guess what I am trying to do is to show an excerpt of the post content on my home page, and if the user wants they can then click to go to the full post. I would really like to have the images included in my content excerpt on my home page to attract the user’s attention. Is it possible?

    Regards,
    Sean

    Thread Starter liujunjie688

    (@liujunjie688)

    And to answer your previous question, the HTML tag in included within full-text RSS content that has been aggregated to my blog posts. As such, it’s possible that tags could exist for video too.

    Sean

    Plugin Author Rafał Gicgier

    (@gicolek)

    Hello again,

    Well the plugin uses default WordPress filter for the excerpt, which means that this will only work for “the_excerpt” and would be ignored for “the_content”.

    You’d have to manually chop the content if you want to achieve the desired result.

    Basically you can do the following:

    1. Use get_the_content() along with http://php.net/manual/en/function.substr.php
    2. Then echo the result using apply_filter( ‘the_content’, $result);

    With respect to the excerpt – I’m not sure how to achieve the desired result you want (as in include the HTML tag).

    Regards,
    Rafal

    Thread Starter liujunjie688

    (@liujunjie688)

    Hello Rafal,

    Sorry, I didn’t understand your meaning of “manually chop the content”. That would be due to my limited understanding of wordpress.

    I’m looking at working around this as follows:
    1/ The RSS aggregator that I’m using can supposively save the external image to server (i.e. to /wp-content/uploads), and if I’ve understood correctly it will then modify the post to reference the local image (preferable so I’m not steeling bandwidth). Unfortunately the feature is doing nothing at all, so I’m taking that up with the plugin author.
    2/ Regardless of the above result, I’ve found a plugin that can set the external image (i.e. referenced by HTML img tag) as the Featured Image for the post. That proved successful…I can now see a thumbnail above the excerpt placed by ACFRPW, and could also modify the thumbnail size using ACFRPW.

    Maybe the 2nd point is a feature that could maybe be incorporated into ACFRPW some day?
    (i.e. for posts matching the ACFRPW filter criteria, if Featured Image not already then set to the HTML img tag)
    If its feasible then its maybe something to consider.

    Regards,
    Sean

    Plugin Author Rafał Gicgier

    (@gicolek)

    Hello 🙂

    I’m glad you’ve managed to sort this one out!

    I expected you to be a programmer due to the way you’ve described the issue, sorry if my answer was too complex (:

    Anyway:

    1. Well this problem is not connected to ACFRPW, so it’s up to you I guess. I don’t want to confuse the others visiting the forum.
    2. I will consider adding that as a feature once I had several other, similar requests. Your setup – although quite tricky – doesn’t seem like a very common feature yet.

    Once all your questions were answered feel free to resolve the topic,

    Regards and good luck with your project!

    Thread Starter liujunjie688

    (@liujunjie688)

    Hello Rafal,

    I work in Telecoms sector so I’m used to writing on technical matters…but I’m very new to WordPress and not a great programmer. So what I’ve learnt from this is that I’ll need to dumb down my writing style when seeking future support 😛

    Agreed this problem is not connected to ACFRPW.

    I’ve marked this post as resolved.

    Suggestion…in lieu of adding a feature in ACFRPW to set featured image, perhaps just a small comment under “Display Thumbnail” to say something like “needs to be set as featured image” would suffice. There seems to be numerous plugins out there to manage Featured Image setting.

    Thanks for your prompt support over the weekend period. Very impressive!

    Regards,
    Sean

    Plugin Author Rafał Gicgier

    (@gicolek)

    Hello,

    Well it’s all a matter of practice I guess 🙂

    I agree with the extra comment. This will take a while though as I will need to update the plugin translation; and I plan to add Spanish and Portuguese in the following weeks – I’ll just push everything together 🙂

    Enjoy the plugin and don’t hesitate to contact me anytime 🙂

    Regards,
    Rafal

    Plugin Author Rafał Gicgier

    (@gicolek)

    Hey liujunjie688,

    I have improved the description per your suggestion.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘how to display html img tags?’ is closed to new replies.