Forum Replies Created

Viewing 15 replies - 1 through 15 (of 51 total)
  • rw1

    (@rw1)

    Yes, im camping right now so cant go into too much detail, but put the above code in your head area of your header.php, then go to https://developers.facebook.com/tools/lint/ to refresh the version of the image Facebook has in ther cache, hope that works for ya! Post back if not!

    Thread Starter rw1

    (@rw1)

    Thanks very much for your reply. I understand the logic, but not the implementation at this stage.

    Would you be able to tell me where the second section of code goes? Is it in the functions.php file?

    I’ve also annotated the second section of code (see below) with my guess of what is occurring and what values could be replaced. Does this look about right?

    function customfolder_copyr($source, $dest) // <------- defines customfolder copy action
    {
        // Check for symlinks
        if (is_link($source)) {
            return symlink(readlink($source), $dest);
        }
    
        // Simple copy for a file
        if (is_file($source)) {
            return copy($source, $dest);
        }
    
        // Make destination directory
        if (!is_dir($dest)) {
            mkdir($dest);
        }
    
        // Loop through the folder
        $dir = dir($source);
        while (false !== $entry = $dir->read()) {
            // Skip pointers
            if ($entry == '.' || $entry == '..') {
                continue;
            }
    
            // Deep copy directories
            customfolder_copyr("$source/$entry", "$dest/$entry"); // <------- defines customfolder copy action
        }
    
        // Clean up
        $dir->close();
        return true;
    }
    function customfolder_backup()  // <------- customfolder backup
    {
        $to = dirname(__FILE__)."https://www.mysite-name.com/back-up-directory/"; // <------- this back up directory will be made
        $from = dirname(__FILE__)."https://www.mysite-name.com/wp-content/plugins/plugin_name/custom-folder/"; // <------- this is the directory that will be backed up
        customfolder_copyr($from, $to); // <------- executes customfolder copy action
    }
    function customfolder_recover() // <------- customfolder recover
    {
        $from = dirname(__FILE__)."https://www.mysite-name.com/back-up-directory/"; // <------- recover the files from this back up
        $to = dirname(__FILE__)."https://www.mysite-name.com/wp-content/plugins/plugin_name/custom-folder/"; // <------- to this location
        customfolder_copyr($from, $to); // <------- executes customfolder copy action
        if (is_dir($from)) {
            customfolder_rmdirr($from);#https://www.mysite-name.com/back-up-directory/ // <------- deletes the backup directory
        }
    }
    add_filter('upgrader_pre_install', 'customfolder_backup', 10, 2); / <------- adds the customfolder_backup filter
    add_filter('upgrader_post_install', 'customfolder_recover', 10, 2); <------- adds the customfolder_recover filter

    (initial code source)

    rw1

    (@rw1)

    hello,

    just wondering if you managed to find a solution for creating a plugin that doesn’t overwrite custom folders and files within the plugin folder upon plugin upgrade?

    thanks very much.

    Thread Starter rw1

    (@rw1)

    ah, woops, the first row becomes the title row, woops ??

    Thread Starter rw1

    (@rw1)

    Thanks for your considered reply. The basic issue is a rather large one (ie adjusting how the plugin outputs the stylesheet reference) and this post was really to see if i could somehow get around that with some css for a temporary solution. I’ve posted a longer description of the how the plugin works here with the aim of trying to find a way to style a secondary lightbox. Thanks again for your input.

    Hello,

    Apologies if this information is not relevant to your situation, but in case it helps, classes for inline lightboxes can be applied to more than one link, so for example you could set up one inline class and apply it on different pages eg:

    <a class="my_new_class" href="link.html">link text</a>

    and then on another page:

    <a class="my_new_class" href="link2.html">link text</a>

    This may prevent the need for more than 20 lightboxes.

    Forum: Plugins
    In reply to: Lightbox – how to use it

    There are various settings in the lightbox plus plugin settings (Appearance>Lightbox Plus) that can be configured for your needs and generally there is no code that needs to be written, for example you can choose to insert a normal wordpress gallery in a post or page and use lightbox plus functionality on that by checking the ‘Use For WP Gallery’ option in the ‘Primary Lightbox: Other Settings’ area of the plugins settings. You can also add a class to a singular link eg:

    <a class="lbpModal" href="link.html">link text</a>

    and that will display the link in a lightbox, to enable this you will need to check the ‘Use Secondary Lightbox’ option in the ‘Lightbox Plus – Enable Optional/Advanced Settings’ and ‘Use Class Method – lbpModal’ option in the ‘Secondary Lightbox – Other Settings’ area of the plugins settings.

    Click on the little information icons next to settings such as these and they will give you a better understanding of how the plugin works and what code can be used.

    Hope that helps!

    Thread Starter rw1

    (@rw1)

    If anyone is interested, i’ve put together a document which explains how the plugin works on a basic level and the issues involved in defining a style for the secondary lightbox.

    Thread Starter rw1

    (@rw1)

    There seems to be a method suggested for doing this mentioned here whilst the code is here – would anyone know how to integrate this code with the wordpress plugin code?

    Thanks very much!

    Thread Starter rw1

    (@rw1)

    Thanks for your reply.

    I was wondering if you could define a thumbnail with any dimensions, regardless of what you had set the thumbnail dimensions to in Settings>Media.

    Edit:

    Ah, i think this has been answered here and where i am up to is just figuring out the correct syntax. Thanks.

    this had to do with a specific setting (Show Share Images) in the Share and Follow Plugin which could easily be unchecked:

    here is a great way to dynamically get the thumbnail versions of the featured image of your posts.

    <?php if (in_category('4') ) { the_post(); rewind_posts();
    echo '<meta property="og:title" content="' . get_the_title(get_the_ID()) . '">';
    echo '<meta property="og:image" content="' . wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) ) . '" />';
    } ?>

    these meta properties are some of the properties that fb looks for when sharing.

    First you will have to add an ‘Inline Lightbox’ in the Lightbox Plus Plugin settings, change the ‘Link Class’ and ‘Content ID’ of this inline lightbox to whatever value you would like eg ‘your-inline-style’, then reference it in your code with:

    <a class="your-inline-style" href="#">Text Link</a>
    <div style="display:none">
    <div id="your-inline-style" style="background: #000000">
    
    <div id="container1"></div>
    
    <script type="text/javascript">
      jwplayer("container1").setup({
        file: "your-video.flv",
        flashplayer: "https://www.your-site.com/wp-content/uploads/jw-player-plugin-for-wordpress/player/player.swf",
        height: 527,
        width: 702,
        autostart: true,
        controlbar: "none",
        volume: 80,
        icons: "true",
        stretching: "fill",
      });
    </script>
    </div>
    </div>

    You will then have to play around with the width and height of the inline lightbox in the plugins settings and the width and height defined in the code above to get a perfect fit.

    Hope that helps!

    Edit: this is also assuming you have the JW Player Plugin for WordPress installed.

    Hello,

    I can add margin-left or margin-right to gallery thumbnails, but can anyone tell me how you could implement this so that the first and last thumbnail of a column is not effected?

    Is there some tricky css that only styles the first and last thumbnail of each column?

    Thanks!

    I’m also getting this warning in 3.0.4.

    Thread Starter rw1

    (@rw1)

    i figured it out, the above code was correct, i had to:

    – add this to the top of each includes:

    <?php
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"https://www.pathtotheme.com/wp-content/themes/theme_name/style.css\" />";
    ?>

    – add the ‘Read More’ link in each include, rather than outside of it.

Viewing 15 replies - 1 through 15 (of 51 total)