Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Having the same problem since upgrade to v.5.2.1

    The same is happening on my sites as for @gresakg

    Unless the post has an excerpt included, the div for the toolbox is on the page, but the javascript isn’t included in the head so the buttons aren’t created.

    Set the excerpt and the javascript and buttons appear.

    Thread Starter shecodes

    (@shecodes)

    Hi Colin

    I also renamed the directory containing the migrated site on my localhost to remove a space between characters. Then it worked. Sometimes it can be the littlest of things…

    Thread Starter shecodes

    (@shecodes)

    Thanks mindctrl and ashiquzzaman, after taking a break I think I’ve fixed it along with your help. I’ve changed the names of the folders the site was located in, so I could reset both the home and siteurl in mysql. Then reopened in browser and permalinks now working. Whiskey time.

    Thread Starter shecodes

    (@shecodes)

    I’ve managed to get MAMP working again (some good news) so at least I can open my wordpress sites and access the admin. To do this I changed the MAMP preference ports settings to 80 for apache, 808 for nginx and 3306 for mysql. But sadly updating to the latest MAMP has made no change to the permalinks working other than the default.

    I’ve also turned off all plugins, and changed to a default theme, switched between default and postname settings for the permalinks, but the problem still persists and only the default will work. Also retested past projects again.

    If there’s other suggestions I would greatly appreciate any help.

    Thread Starter shecodes

    (@shecodes)

    Thank you both for your responses. However. Still no joy. I have now updated MAMP as a last resort, but had resisted because I’d found comments from several threads that everything broke after the update. And yep, I now can’t access anything. Pull out hair time. Im getting an error from all browsers ‘can’t establish a connection to the server at localhost’. I’ll keep trying to see if I can fix…

    Thread Starter shecodes

    (@shecodes)

    Ha thanks Joe, although I’m not sure I’ve progressed much from the pea spewing image! Appreciate your help though.

    Thread Starter shecodes

    (@shecodes)

    Hi Joe

    Thanks for your comment, I’m not going mad then! I did try manually adding a ‘sizes’ attribute as per an article I’d found in the meantime over on css tricks by using what I have assumed is a default value sizes=”100vw”. So that sorts my custom image fields created with the ACF plugin.

    I gather that for now, sit tight until there’s a plugin update to resolve for feature images and the images uploaded into posts?

    This is what I had done:

    <?php 
    
    if (get_field('custom_image') != '') {
    $image = get_field('custom_image');
    //vars
    $url = $image['url'];
    $id = $image['id'];
    $alt = $image['alt'];
    echo "<img alt='$alt' sizes='100vw' src='$url' ";
    echo tevkori_get_srcset_string( $id, 'full' );
    echo "/>";
    }
    
    ?>
    Thread Starter shecodes

    (@shecodes)

    Hi Jeremy

    Thanks for your response, the css addition to stop the ‘loading comments’ has worked a treat.

    I will supply the gallery link via the contact form as you have suggested now, with a link to a mobile screenshot file.

    Brilliant!

    Thread Starter shecodes

    (@shecodes)

    Wow, thanks bcworkz for taking the time to give such an informative response.

    I must admit I was peeking through my fingers at my inbox as I thought this might sadly be the case. I am unfortunately bear of little brain when it comes to scripting so this will have to be a spare time challenge for me to work out, and a plugin will have to suffice for now as I have a site to launch next weekend.

    But I am very appreciative of the starting point you have given me. I was trying to utilise the gallery without the need for a popup as I don’t think they are appropriate across devices. I was trying to minimise page load as each attachment page is one image only, which is made ‘responsive’ with the RICG plugin. I also don’t like having the pinch zoom ability taken away which always seems to break on most gallery plugins on mobile. So I was trying to emulate a plugin ‘look’ as user testing suggested that people have come to expect the next/prev and close buttons. I was using the thumbnail links to open the attachment page ‘disguised’ as a popup without being a popup so the ‘close button’ was actually an anchor link back to the parent gallery. From what you have said I can now see why this only works if the images have been loaded next to each other in the media library. Time to go research on how to do it properly…

    Thread Starter shecodes

    (@shecodes)

    Thank you so much for pointing me in the right direction, you are genius.

    By using the wp_prepare_attachment_for_js I was able to locate ‘uploadedTo’ which gave me the ID of the parent gallery for the image ($gallery). I could then check the custom post type by using get_post_type on the parent gallery ID ($gallery). The value of this ($gallery_type) is either ‘galleries1’ or ‘galleries2’.

    $meta_capture = wp_prepare_attachment_for_js( get_post_thumbnail_id( get_the_ID() ));
                                                            $gallery = $meta_capture['uploadedTo'];
                                                            $gallery_type = get_post_type( $gallery );

    So I can now load two different content templates depending on the value of $gallery_type. Perfect!

    Thread Starter shecodes

    (@shecodes)

    Oh I am so sorry I have only just spotted your reply : (
    I will email you now.

    I’ve finally managed to crack this (I think…) by following a few of kylereicks posts.

    Step 1:
    I’ve downloaded picturefill2.js from github to install the plugin “Picturefill.WP 2” into WordPress. I then specified the image sizes using my theme css breakpoints in the WordPress admin settings > media. To resize any existing images in the media library to match the new image size settings I used the “Regenerate Thumbnails” plugin.

    Step 2:
    Was to create a custom image field in ACF, which for this example I’ve called “your_custom_image_fieldname”. The Field Return Value I have set to “image URL”.

    Step 3:
    In the functions.php I have added:

    add_filter('theme_acf_image', 'theme_function_for_acf_image', 10, 2);
    
    function theme_function_for_acf_image($content, $name_of_the_image_field){
      return Picturefill_WP::get_instance()->cache_picturefill_output($content, $name_of_the_image_field);
    }

    I didn’t need to make any changes to this and it was a straight copy and paste.

    Step 4:
    In the theme’s template file I added:

    <?php
    $image_url = get_field('your_custom_image_fieldname');
    $image_output = '<img src="' . $image_url . '" />';
    echo apply_filters('theme_acf_image', $image_output, 'your_custom_image_fieldname');
    ?>

    So as you can see, you need to replace “your_custom_image_fieldname” in two places with the name of your particular ACF image field’s name. You can also specify any id or class within the img tag if you want.

    This seems to be very simple compared to some other solutions I found, but this was the only way I could get it to work.

Viewing 13 replies - 1 through 13 (of 13 total)