Per S?derlind
Forum Replies Created
-
The Zend framework is doing something similar to this:
https://gist.github.com/soderlind/3d620201fced5631247edff7b5485c9aForum: Plugins
In reply to: [WP SmartCrop] 2.0.0 does not work under WP 5I can confirm that 2.0 doesn’t work on WordPress 5.0.3,
data-smartcrop-focus="["X","Y"]
isn’t set on images loaded bywp_get_attachment_image()
1.5 works with 5.0.3
Forum: Plugins
In reply to: [Proxy Cache Purge] 4.6.2 gives me Uncaught exception ‘Error’*facepalm* Couldn’t find purgeURL in Polylang, so I search my code. Looks like I have the following to my theme:
} elseif ( 'publish' === $post->post_status ) { // Purge varnish cache if ( class_exists( '\VarnishPurger' ) ) { $varnish_purge = new \VarnishPurger(); $varnish_purge->purgeUrl( get_permalink( $post_id ) ); } }
- This reply was modified 6 years, 8 months ago by Per S?derlind.
Forum: Plugins
In reply to: [Proxy Cache Purge] 4.6.2 gives me Uncaught exception ‘Error’Thank you, I’ll pass this on to the guy at Polylang
Forum: Plugins
In reply to: [Polylang] Polylang and WP customizer optionsI just released an add-in that gives you full Polylang support in WordPress customizer. You’ll find it at https://github.com/soderlind/customizer-polylang
My bad for using
plugins_url()
in my example above. When you’re using this in your (child) theme, useget_stylesheet_directory_uri()
eg:wp_enqueue_script( 'wp-pause-playlist-on-next', get_stylesheet_directory_uri() . '/js/wp-pause-playlist-on-next.js', array( 'wp-playlist' ), WPPPON_VERSION, true );
Forum: Plugins
In reply to: [Flexible Posts Widget] Stop duplicating IDs.. this is the line, in the template, causing the issue:
<li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
Forum: Plugins
In reply to: [Read Offline] How to change “download odf” and “print” labelsNo, neither if you create a translation nor if you use the shortcode.
Forum: Plugins
In reply to: [Read Offline] How to change “download odf” and “print” labelsIf you want to translate the labels you should use the language file
languages/read-offline.pot
. WPML has a nice article on how to do this.You can also use the Read Offline shortcodes:
[pdf text="Click to download the PDF"] [print text="print me!"]
btw, saw that I’m missing a wrapper around the generated html for shortcodes, which makes it harder to align them. I’ll add a wrapper soon.
Forum: Plugins
In reply to: [Read Offline] How to show pdf and print buttons on top corner rightThe HTML generated by the plugin looks like:
<div class="readoffline-embed"> <div class="readoffline-embed-text">Read Offline: </div> <div><a class="pdf" href="https://dev.local/read-offline/992/.pdf" title="Download .pdf">Download PDF</a></div> <div><a class="print" href="https://dev.local/read-offline/992/.print" title="Print ." onclick="read_offline_print_me();return false;">Print</a></div> </div>
so you could add the following to your (child) theme style.css to move the buttons to the right:
.readoffline-embed { display: flex; justify-content: flex-end; }
btw, I respond quicker to issues if you post them at GitHub
Yes, add the code to functions.php in your child theme.
Put this in the functions.php
define( 'WPPPON_VERSION', '1.0.0' ); // update version number when you change the javascipt code add_action( 'wp_enqueue_scripts', 'wp_pause_playlist_on_next' ); function wp_pause_playlist_on_next() { wp_enqueue_script( 'wp-pause-playlist-on-next', plugins_url( '/js/wp-pause-playlist-on-next.js' , __FILE__ ), array( 'wp-playlist' ), WPPPON_VERSION, true ); }
and here is js/wp-pause-playlist-on-next.js:
jQuery(function ($) { $('.mejs-mediaelement video').on('ended', function (e) { e.preventDefault(); $(this)[0].player.pause(); }); });
btw, I’ve done a plugin that lets you link to audio/video in a playlist. It might have code you’d like to borrow from: https://github.com/soderlind/wp-link-to-playlist-item
Forum: Plugins
In reply to: [Read Offline] CSS: @pageSorry for the late answer, you’ll reach me quicker via github.
For PDF, see Supported CSS attributes
Forum: Plugins
In reply to: [Read Offline] How to use the shortcodeYou can add the shortcodes to your theme by adding the following:
<?php echo do_shortcode("[pdf]"); ?>
<?php echo do_shortcode("[epub]"); ?>
<?php echo do_shortcode("[mobi]"); ?>
Forum: Plugins
In reply to: [Read Offline] XX displaying on top of post before categoryLatest version, 0.7.4, fixes this. I’m sorry that I didn’t catch and fix this earlier.
Forum: Plugins
In reply to: [Read Offline] fatal errorFixed, please try the latest version