Forum Replies Created

Viewing 15 replies - 76 through 90 (of 91 total)
  • Thread Starter Lyk

    (@lyk-1)

    Oh, I didn’t know that!

    What query could do that?

    Thank you!

    Thread Starter Lyk

    (@lyk-1)

    I guess you are talking about the code in the functions.php ?

    Yes, maybe I try that as a temp solution for a while..

    Update: I tried with the regex you wrote but it seems to match everything, i.e. all the post is removed apart from the featured image.

    The regex in the link works. I hadn’t notice before because I was checking the homepage. So it works for every post, but the problem still shows up in the homepage.

    Thread Starter Lyk

    (@lyk-1)

    Hello Andy,

    Yes, it is theme related, but it is quite probable that a theme shows the featured image at the top of each post (probably in some different/special way)

    I was thinking that it might be easy to be done by tweaking the part that:

    updates the html in the post to point at the new images

    So something like:

    if ($imgcount == 0)
    {
        // update the html in the post with nothing, i.e. omit the matched regular expr
        set_post_thumbnail($post_id, $att_id);
    } else {
        // update the html in the post to point at the new images.
    }

    But apparently it is not as simple as it looks.

    I also did some searching for some plugin that just removes the first image from every post, but have not find something yet. This should be simple but I am really new in wordpress ?? . Such a plugin will do the job right?

    Apart from that, I found this https://setwordpress.com/2011/09/29/how-to-remove-first-image-from-wordpress-posts/
    but for some reason it does not work for me.
    Moreover, -if I got it right- this will not really change the content of the posts and will only change the way they appear (on the fly each time). Which is not very good.

    PS: it also seems that there is a redundant condition in the if(), unless I really miss something?

    Thank you!

    Thread Starter Lyk

    (@lyk-1)

    Hello and sorry for the late reply :/

    Yes, I think I understood how it works. As for the size issue, who know… ??

    Thread Starter Lyk

    (@lyk-1)

    Thank you very much ??

    I have one last question. Now as you know, every first picture is set as featured image.
    I noticed the following:
    Say I have an 5.img as first image which is 1600px × 1066px (512KB in size). The featured image is an image name 5-1000×600.jpg which of course is 1000x600(566 K in size). Why is that the case?

    Does this have to do with the theme I am using, wordpress itself or the importation from blogger?

    Both images appear scaled down, with is fine but the smaller one has a bigger size which is strange. Is this a result of wordpress’s downscaling?

    Thread Starter Lyk

    (@lyk-1)

    Update:

    I ended up importing with the following settings:

    • MAX_IMAGE_SIZE 1600
    • batch size for images 1
    • set_time_limit( 180 );
    • Size in Settings->Media: 700 for medium, 1600 for large
    • Using the beta plugin

    There were quite a few stops but without any corruption. Also the problem I mentioned above did not occur this time(!)
    For now everything seems to be ok

    Thread Starter Lyk

    (@lyk-1)

    Update I narrowed it down to 3 recent posts that where causing issues and in the end it seems that the mess was caused by some inline styles like:
    margin-left: auto; margin-right: auto;

    I guess these were there in the blogger blog before the importation and they were just transferred. Since they are just 3 (hopefully there are not any other I did not notice) I will correct them by hand if I do not find any relevant plug-in.

    However, it might be a good idea to provide an option during the importation to strip the content from any inline styling etc. Not sure how easy that is though

    Thread Starter Lyk

    (@lyk-1)

    It is not a huge problem since every image is fine, but will try it since (I guess) it does not have any side-effects.

    One more question: How can I cancel the “Set the first image as featured”? I have to admit that I have not checked the code, but I thought I would ask first. Reason I want to skip it is that most posts were starting with the image and the result is have the same image twice at the beginning of each post.

    Thanks again

    Thread Starter Lyk

    (@lyk-1)

    Ok, will try that too.
    Yes, I have imported quite a few times and I clean everything before a new import.

    Small notice: with the dev version, 1600px max images size in the plugin’s option (.php file) and batch size of 2 it still stopped after apprx 300-400 images.
    However, the last imported images seem to be fine and appear correctly in the media library.

    PS: I now continue the importation with batch size of 1. I guess it does not matter that I changed the batch size in the same importation session (but of course after it had stopped). Is there any other way to make it stop less often?

    Thread Starter Lyk

    (@lyk-1)

    For the post breaking the theme yes, this is what I will try to do. Will report back with the finding in case something is useful.

    For the images yes, I guess that is more a blogger problem and not really related with the plugin.

    So if I change the medium size from settings->Media to something bigger it should work?

    Right now I am trying with the dev version to see how it behaves

    Thanks for you answer!

    Thread Starter Lyk

    (@lyk-1)

    Did some more digging and it seems that it just happens that some of the last posts are “corrupted” (I guess having unclosed tags or something?) and this explain the problem I mention in the post above.

    I am saying this because after deleting some of these posts everything seems fine.

    Will try to check manually and be more specific.

    Thread Starter Lyk

    (@lyk-1)

    Any suggestion on how to overcome this?

    One more comment feedback: After importation finished successfully I applied a theme (non-free) and things went really messy. Things like: on the first page, the 3rd post was inside the 2nd and the 4rth inside the 3rd and then a mess.

    Not sure if this is a problem with the theme since I had no issues with that theme before and I am also using it.

    Could it be some extra/missing tags iniside the post or…?

    Thread Starter Lyk

    (@lyk-1)

    Hm I guess I will have to try that. But thanks!

    As for the size I am not sure that this is the issue. And here is why:
    * In the same post in blogger there are 2 pictures 1066 x 1600
    * They are both <img width="426" height="640" ...
    * In the wp they are both:

    <img width="426" border="0" height="640" src="url/pic.jpg"></img>

    However, one of them is actually using pic-199×300.jpg as source for the img.

    By the way, the href for the problematic one in blogger is something like https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http.
    I do not know if that makes any difference but let’s notice some things:
    1) the problem also appears to other images where the blogger href is fine.
    2) the problematic href does not work even in blogger, i.e. if I click the image is “recognized” as .txt. (If I open the file, it is really the image thought. The mime or extension seems to be wrong for some erason)
    3) Even though the img tag is to the thumbnail of the image, the problematic href is preserved in wp too. I guess this is normal since it is not recognized as image.

    But anyway, this seems like a separate problem and as I mentioned the res issue happened with other images too, which have correct hrefs.

    Thank you again ??

    Thread Starter Lyk

    (@lyk-1)

    So the importation finished without any stops this time. This is really good since I didn’t have to click every few mins & there must be n corrupted images.

    However, I noticed a strange issue:

    For some of the posts, lower resolution images are used e.g.
    a 300px × 200px image is used in an <img> that looks like:

    <img src=”https://url/image_name-300×200.jpg” height=”426” width=”640“>

    Of course this results in a visibly ugly image in the post.
    The bigger resolution image exist and in fact it is even used as the link when one clicks the crappy image:

    <a href="url/image_name.jpg"> <img src="https://url/image_name-300x200.jpg" height="426" width="640"> </a>

    I guess this has to do with Step 2 that you mention above:

    Use big image to re-generate the smaller sizes based on your wordpress settings

    On which settings is this based on? The ones I see in wp-admin/options-media.php ?

    Thread Starter Lyk

    (@lyk-1)

    Hello, again ??

    So, right now I am importing with 1024 image size and $batchsize 4 and it seems much better. Already half way through with not a single stop.

    Smaller batchsize seems to help, unless it has to do with the smaller image size. Now I use 1024, but before I was using 1600.

    The strange thing is that the “corrupted” images seems quite fine, except for the things I mention. That means, I can see it in full size and it appears in the posts. But anyway, this only happen with every stop (case where I had to refresh and click import again). So if there are not stops, all the images are fine.

    As for the specific plugin I am thinking of this one
    https://www.ads-software.com/plugins/amazon-s3-and-cloudfront/
    so that I can have the images only in S3 and not on the hosting shared server.

    Thank you for your time again, much appreciated ??

Viewing 15 replies - 76 through 90 (of 91 total)