Mr. Shiv
Forum Replies Created
-
Forum: Plugins
In reply to: [Audio Player] How can I add a Download Button to the Audio Player?Actually, it does work in 3.3.2 now. After a lot of frustration, I discovered that my hand-rolled theme had this crucial line in the wrong location:
<?php wp_head(); ?>
This bit of code should go in your header.php file. In my case, I was also using header.php to bring in some design elements from elsewhere on the site (i.e. outside of the WP blog portion of my site). Somehow this additional include() broke the functionality of wp_head(). After moving the wp_head() line down a bit in header.php, everything started working correctly.
Forum: Plugins
In reply to: [Audio Player] How can I add a Download Button to the Audio Player?Yeah, now if I can only get this to work in WP version 3.3.2. ??
Forum: Plugins
In reply to: [Audio Player] How can I add a Download Button to the Audio Player?I figured out how to add a download link.
Use the WP plug-in editor to edit audio-player/audio-player.php. Find the sendToEditor() function, starting around line 696. In this short function, there’s a block:
if (strlen($matches[5]) > 0) { $html = preg_replace("/]$/i", "|titles=" . $matches[5] . "]", $html); }
Add the following line immediately after that block:
$html .= " <a href='" . $matches[3] . "'>[download]</a>";
This will insert a [download] link just after (or below) the player, when you use the “Add Audio” button in your post, then the “Audio Player” button, and finally the “Insert into Post” button. In your Audio Player plugin settings, “Replace [audio] syntax” must be enabled, and “Replace all links to mp3 files” must be disabled.
If you want a button, you could add a class to the link in the above code, and use some CSS to style it, or just hard code a button of your choice.
This is a pretty crude shortcut, but it does work.
Forum: Plugins
In reply to: [WPaudio MP3 Player] [Plugin: WPaudio MP3 Player] Just does not work….BTW I think this is related to the WP version. I tested this plugin on another WP blog, version 3.2.1, and was able to make it work via the fix described here. But this fix will not work on my WP version 3.3.2. So perhaps it’s no longer compatible?
Forum: Plugins
In reply to: [WPaudio MP3 Player] [Plugin: WPaudio MP3 Player] Just does not work….Yeah, same problem here — no conversion of MP3 links, just link inserted into post as if the plugin isn’t installed.
D’oh! I always forget about !important. Thanks for the reminder.
I just saw the post at https://www.ads-software.com/support/topic/plugin-custom-field-template-can-i-arrange-the-admin-page-with-css, which explains how to use an external stylesheet for CFT on the Admin pages. Also just noticed the ADMIN CSS area of the CFT options page.
However, inline styles (such as style=”height:25px;”) always override styles applied via embedded or external CSS. So, could you please at least remove the admin meta-box embedded styles from this plugin on the next update? Specifically, in the insert_custom_field() function, around lines 2436 – 2466 in custom-field-template.php. Then I could just use the ADMIN CSS options to fix the meta box the way I like it.
Thanks!
The code in my previous post ignores the taxonomy titles, but those would be easy to add via something like:
<?php if (is_multitax()) { foreach ( qmt_get_query() as $tax => $slug ) { $terms[] = get_taxonomy( $tax )->label . ': ' . get_term_by( 'slug', $slug, $tax )->name; } ?> <h1 class="pagetitle">Updates filtered on <?php echo implode( ", ", $terms ); ?></h1> <?php } ?>
Here’s how I did it:
<?php if (is_multitax()) { foreach ( qmt_get_query() as $tax => $slug ) { $terms[] = get_term_by( 'slug', $slug, $tax )->name; } ?> <h1 class="pagetitle">Updates filtered on <?php echo implode( ", ", $terms ); ?></h1> <?php } ?>
Forum: Plugins
In reply to: [W3 Total Cache] [Plugin: W3 Total Cache] Plugin triggers a fatal errorI’ve wasted half a day trying to activate this plug-in. Yes, /wp-content/ is 777, and so is /wp-content/uploads/.
Are there any instructions for manually activating the plug-in?
Thanks
Forum: Fixing WordPress
In reply to: Require post title – prevent posts with no titleIf anyone’s still interested, I was able to add this feature.
require-title.js (put in your theme directory)
jQuery(document).ready(function($){ $('#post').submit(function(event){ var title = $('#title').val(); if( title.length == 0 || title.replace(/\s/g,'').length == 0 ){ event.preventDefault(); $('div#notice').remove(); $("<div id='notice' class='error below-h2'><p>A title is required for all updates.</p></div>").insertAfter('h2'); alert("A title is required for all updates"); $('#title').focus(); $('#ajax-loading').hide(); $('#publish').removeClass('button-primary-disabled'); } }); });
(I’m sure this javascript could be written more elegantly.) Then, add this to your theme’s functions.php:
// Require post title if ( is_admin() ) { wp_enqueue_script('require-post-title', get_bloginfo('template_directory') . '/require-title.js'); }
this will pop up an alert box and put a red box at the top of the new/edit post form if the title is left blank.
Forum: Plugins
In reply to: [WP Easy Post Types] [Plugin: WP Easy Post Types] A few other improvementsHmm, the new version is not showing up as an UPDATE option in my WP installation. Guess I can try the download.
Forum: Fixing WordPress
In reply to: Require post title – prevent posts with no titleI have the same problem. It’s odd that there’s no setting or plug-in available to prevent it. Would love to hear of a solution.
Forum: Plugins
In reply to: [Plugin: Custom Field Template] How to hide custom fields on Pages?Well, I “fixed” this on my own — I’m just not using the “Auto-hook of ‘the_content()’ (Experimental Option)”. Instead, I added the following to my theme templates, where it’s needed:
<?php echo do_shortcode('[cft format=0]'); ?>
In my case, I’m inserting that above the_content(), but it could go anywhere in the Loop.
Shiv
Forum: Plugins
In reply to: [Plugin: Custom Field Template] How to hide custom fields on Pages?Thanks Mr Hirokai, it’s better, but still not working right. Again, perhaps I’m missing something. I would like to display a set of custom fields for each post, not just on the single-post view, but also on category archives, the index page, etc.
With your update, I can hide the custom fields on Pages, but doing that also hides them on post listing pages, such as index.php or listings by category (?cat=nnn) or date (?m=200911).