• Resolved Northfence

    (@northfence)


    Hi.

    Im currently trying to change the way thumbnails links to the full image.
    Like it is now, when i click a thumbnail in a post, it first opens up a page with the image attachment id link, then i have to click it once again to see the full size image.

    I want it to go straight for the full size image, skipping the attachment id.

    I’ve tested a few things others have suggested in the main support forum, ( to other users with sort of the same problem) but everytime I insert or alter some of the code in selected php files, my site stops working or nothing happends.

    The only thing thats close, is using shortcodes, wich i reasently learned that the postie plugin supports. 😉

    Is there any way that I can use shortcodes to achieve what I want?
    I’ve allready tried to use the [gallery link="file"] code, but then I get all the attachment thumbs stackedup in the top of the post. And leaving the rest like it always been.
    I dont know if its possible but i would like all of the images in the email, including the featured, to be affected the same way as the thumbs are with the gallery shortcode.

    I’m not very good at this, and i would be very thankfull for any help.

    *edit:
    My site http://www.northfence.com
    https://wordpress.org/plugins/postie/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    What you are trying to do can be accomplished with a small script and some settings changes.

    First create a file in the wp-content directory called filterPostie.php and put the following code in it:

    function my_postie_gallery($post) {
        $post['post_content'] = str_ireplace('[gallery]', '[gallery link="file"]', $post['post_content']);
        return $post;
    }
    
    add_filter('postie_post_before', 'my_postie_gallery');

    In the Postie settings set Preferred Text Type to Plain and Automatically insert image gallery to No.

    Now any email that has attached images will have the correct gallery shortcode.

    Thread Starter Northfence

    (@northfence)

    Thanks, But I´m not getting any changes to the images.
    Maybe I´m doing something wrong?

    Only difference I can see is that the code is shown when doing the manual update.

    Checking for mail manually
    Starting mail fetch
    Postie is in /home/northfence/www/wp-content/plugins/postie/
    Cron: On
    Alternate Cron: Off
    iconv: installed
    Warning! Postie requires that imap be enabled if you are using IMAP, IMAP-SSL or POP3-SSL.
    mbstring: installed
    function my_postie_gallery($post) { $post['post_content'] = str_ireplace('[gallery]', '[gallery link="file"]', $post['post_content']); return $post; } add_filter('postie_post_before', 'my_postie_gallery');
    There are 1 messages to process
    Mail fetch complete, 1 emails
    Plugin Author Wayne Allen

    (@wayneallen-1)

    Sorry, I forgot to tell you that the very first line of the file filterPostie.php should be <?php like this:

    <?php
    
    function my_postie_gallery($post) {
        $post['post_content'] = str_ireplace('[gallery]', '[gallery link="file"]', $post['post_content']);
        return $post;
    }
    
    add_filter('postie_post_before', 'my_postie_gallery');
    Thread Starter Northfence

    (@northfence)

    Did the correction.
    The codeline from the manual update is not showing anymore.
    But all images remain unchange.

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Please contact me at help@postieplugin.com if you’d like me to log into your site and see what is happening.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trying to change the way the thumbnails links to the image in the gallery.’ is closed to new replies.