Forum Replies Created

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter WriterDan

    (@writerdan)

    Figured it out. I hadn’t enabled Amazon Polly for the article post yet.

    Seems like there should be a more robust way of doing things in this instance. Especially given the fact that WordPress is so amazing in this regard. So, here’s a small suggestion. I’ve made a couple shortcodes (for my own use) that take advantage of the power of the WordPress shortcode. They might be useful for you to implement into the plugin instead of using custom string-replace functionality.

    function amazon_polly_audio_only_shortcode($atts, $content = NULL) {
    

    global $post;

    
    

    $tagged_content = ”;

    	if($content!==NULL) {
    

    $tagged_content = do_shortcode($content);

    		if(intval(get_post_meta($post->ID, 'amazon_polly_enable', TRUE))===1) {
    

    $tagged_content = PHP_EOL.’-AMAZONPOLLY-ONLYAUDIO-START-‘.PHP_EOL.$tagged_content.PHP_EOL.’-AMAZONPOLLY-ONLYAUDIO-END-‘.PHP_EOL;

    		} else {
    

    $tagged_content = PHP_EOL.'<!– Amazon Polly not enabled on this post –>’.PHP_EOL.$tagged_content.PHP_EOL.'<!– Amazon Polly not enabled on this post –>’.PHP_EOL;

    		}
    

    }

    	return $tagged_content;
    

    }

    add_shortcode('polly_only_audio', 'amazon_polly_audio_only_shortcode');
    
    function amazon_polly_words_only_shortcode($atts, $content = NULL) {
    

    global $post;

    
    

    $tagged_content = ”;

    	if($content!==NULL) {
    

    $tagged_content = do_shortcode($content);

    		if(intval(get_post_meta($post->ID, 'amazon_polly_enable', TRUE))===1) {
    

    $tagged_content = PHP_EOL.’-AMAZONPOLLY-ONLYWORDS-START-‘.PHP_EOL.$tagged_content.PHP_EOL.’-AMAZONPOLLY-ONLYWORDS-END-‘.PHP_EOL;

    		} else {
    

    $tagged_content = PHP_EOL.'<!– Amazon Polly not enabled on this post –>’.PHP_EOL.$tagged_content.PHP_EOL.'<!– Amazon Polly not enabled on this post –>’.PHP_EOL;

    		}
    

    }

    	return $tagged_content;
    

    }
    `add_shortcode(‘polly_no_audio’, ‘amazon_polly_words_only_shortcode’);

    I’ve verified that this setup work for my use case. I’m not sure if the solution will need to be tweaked to work in a general case.

    I have another ticket open currently about style tags being converted to audio, and this solution will take care of that use case as well. I’ll close it out.

    Thread Starter WriterDan

    (@writerdan)

    Custom theme and latest version of the plugin.

    So I changed nothing (theme/core/plugins) on the site, but this functionality seems to be working now. I verified three separate times yesterday that it wasn’t working, and now it is. Guess I’ll just have to watch and see if it starts misbehaving again to determine what might have been the issue.

    Thanks anyhow.

    Thread Starter WriterDan

    (@writerdan)

    Update: I found the custom field value (amazon_polly_audio_link_location) that contains the actual location of the generated audio file. If I put that url directly into my browser, the audio file starts playing and it looks like it was converted correctly.

    I’m not sure why the inserted player on the page isn’t using the file for the play or download functionality though.

    Thread Starter WriterDan

    (@writerdan)

    Only really interested in updating the version of the theme that is available on WordPress.com. Thanks.

    Thread Starter WriterDan

    (@writerdan)

    Found it.

    Official Google Site Verification Plugin.

    Somebody else on the team put the plugin on the site. It adds a meta tag to the header and… that’s it.

    Genius.

    Thanks for reminding me that I know how to do a simple search on Linux. Grep is your friend peoples.

    Great plugin by the way. Works like a charm.

    Thread Starter WriterDan

    (@writerdan)

    Ran into another instance today where having the above functionality within the plugin code would have saved me a load of time and headache.

    Thread Starter WriterDan

    (@writerdan)

    Looking at that page, I’m not sure which of the buttons are supposed to be there and which are not. Right now I’m seeing a Share This button near the top of the content block and another one near the bottom. Right now, if I had to guess, I’d say that the one at the top of the page is showing up because of the shortcode, and the one near the bottom is showing up because of the plugin settings (mainly because I see the same button at the bottom of other pages on your site, but not on the top).

    To use the shortcode I’ve supplied, you do still need to define which buttons you want to see rendered on the page within the plugin’s settings page. My shortcode only renders the buttons that you’ve defined in the locations where you put it.

    If you run into the situation where a text version of the shortcode is showing, then the theme you’re using is probably showing the content without running the WordPress shortcode parsing functions. (Not sure if you’ll need that info or not).

    The issue with effects of changes showing up hours after you make them makes it sound like some kind of caching is going on. Whether that’s happening within WordPress (with a plugin like W3 Total Cache or Super Cache), or if it’s something that your hosting company is doing is beyond me at this point. Typically, if there’s no caching going on, changes you make should translate to the rendered page immediately. If you don’t have an active caching plugin on this site, or caching functionality built into your theme, I’d call your hosting company and see what they can tell you.

    Best of luck.

    Thread Starter WriterDan

    (@writerdan)

    The shortcode is called st_buttons (as defined by the add_shortcode function call at the end of the code block). So to get the buttons to render, place this into your content box:

    [st_buttons]

    Works out great for us.

    Note: If you directly alter the plugin file by using this code, you’ll have to be careful when you upgrade the plugin (and re-insert the code in the new plugin file) or you will lose the shortcode functionality.

    Dan

    Thread Starter WriterDan

    (@writerdan)

    It looks like it’s definitely an issue with the CDN not responding as snappily as it should be. The FAQ section mentions that the plugin automatically uploads all new images to the defined cdn. So, it’s nothing that is, per se, incorrect with this plugin. We just need a high-level option to turn off this feature. This will, of course make it so that we’ll have to upload all new images to the cdn via the bulk methods. I’ll take the fast input any day though.

    I’ll try to take some time and find where this is happening in the plugin and let you know what I find Ammalgam. Anything will help at this point until Frederick is able to get to this. As it’s not a debug issue, my guess is that it’ll be pretty low on the totem pole.

    Thread Starter WriterDan

    (@writerdan)

    Sounds like a job for Superman.

    Frederick, is this conversion already on your docket of things to do? If so, I’ll keep a low profile and just wait this out. 🙂 Thanks.

Viewing 10 replies - 16 through 25 (of 25 total)