David Hunt
Forum Replies Created
-
Forum: Hacks
In reply to: How to add access keys to wp_nav_menuIt’s been a year since I posted that code, and I have learned a lot about accessibility since then!
I also want to thank Esmi for taking the time to make this an informative thread.
Forum: Plugins
In reply to: [Download Monitor] SEO titles for Download Monitor file and category pagesI looked at a sample page on your site and, from the source, can see the the meta description appears twice in the
<head>section:<meta name="description" content="[download_page pop_count="333" exclude_cat="1,2,3,4,5,48,51,52,107,236,190,268,269,270,271,272,325,266,426,427,428,429,430,444,445,446,447,448,449,450" />and then
<meta name="description" content="Download: Photo Grid - Collage Maker for BB10"/>The second one is the output of my code — I am not sure where the first one comes from, maybe from the theme you are using. But clearly you shouldn’t have two descriptions in your header, so you’ll need to investigate what is producing that first description, and disable it.
Hope that helps.
David
Forum: Plugins
In reply to: [Download Monitor] SEO titles for Download Monitor file and category pagesSorry, I use Yoast’s plugin. I’ve never used All in One SEO, so I’ve no idea if this script could be used for that plugin.
Forum: Plugins
In reply to: [Download Monitor] SEO titles for Download Monitor file and category pagesYup, in functions.php, and it doesn’t affect the other script.
Forum: Plugins
In reply to: [Download Monitor] SEO titles for Download Monitor file and category pagesHi Goodereader!
I did create a similar function for meta descriptions, but it relies on the WordPress SEO plugin by Yoast. If you don’t already use that plugin, I can highly recommend it.
Here’s my function:
function dvd3141_downloadmonitor_metadesc($metadesc){ // SEO meta descriptions for individual Download items if (isset($_GET['did']) && is_numeric($_GET['did']) && $_GET['did']>0 && function_exists(get_downloads)) { $did = $_GET['did']; $dl = get_downloads('limit=1&include='.$did); if (!empty($dl)) { foreach($dl as $d) { $metadesc = __('Download: ','namespace').$d->title; } } } // SEO meta descriptions for Download taxonomy pages elseif (isset($_GET['category'])) { $catID = $_GET['category']; // First need to get category name using $catID global $wpdb, $wp_dlm_db_taxonomies; if (isset($wp_dlm_db_taxonomies)) { $cat = $wpdb->get_var( "SELECT name FROM $wp_dlm_db_taxonomies WHERE id = $catID;" ); // Find out if we're on a paginated page (but not page 1), and if so, set the variable if (isset($_GET['dlpage']) && is_numeric($_GET['dlpage']) && $_GET['dlpage'] != 1) $dlpage = $_GET['dlpage']; // Then we can use the category name and, if set, the pagination page, in the meta description $metadesc = __('Downloads in the category of: ', 'namespace').$cat; if ($dlpage) $metadesc .= ' (Page '.$dlpage.')'; } } return $metadesc; } add_filter( 'wpseo_metadesc', 'dvd3141_downloadmonitor_metadesc');As you can see, my function still uses the download’s title in the meta description, but you could feasibly replace that with the download’s description, although you should probably truncate it.
Hope that has provided a useful starting point for you.
Best,
David
I used the Wayback Machine to find an archived copy of the BuddyPress forum. This is what I had posted on there:
Well, I found a workaround. For me it wasn’t a problem with the toggle … kind of.
I found that in the function invite_anyone_bypass_registration_lock(), it was this check that was causing the failure:
$bp->current_component != BP_REGISTER_SLUG
This seems to be because (i) I had changed the slug of my BP registration page and (ii) my registration page is a child page of another page.
Workaround: I set my slug to be “register” and set the registration page to be a main page — and lo-and-behold, email invitations work again even with site registration disabled.
I don’t know if that’s a bug in WordPress, BuddyPress, or this plugin. Hopefully this workaround will help others to have a functional site.
Another thread also reports this bug, and suggests a fix. See here:
Hopefully the fix will be incorporated into the next update.
I just found there are at least two other threads about this bug.
I just tried this fix but it did not work for me, using version 4.3.3 of the plugin with WordPress 3.5.1. The custom code string is still truncated and contains backslashes.
Joost, is there any chance a fix can be incorporated into the next update?
I am seeing exactly the same problem.
Using WordPress 3.5.1 with plugin version 4.3.3.
A textarea would be great for adding more complex custom code.
Forum: Plugins
In reply to: [BuddyPress Activity Plus] Deleting activity does not delete uploaded images@angelsih: Yes, put it in your theme’s functions.php file.
Forum: Plugins
In reply to: [Latest Vines] Can't set up Twitter accessAh, sorry about that! I was only looking on the “Details” tab in the Twitter Dev page. I didn’t realise that the “OAuth” tab contained the “Access token” and “Access token secret” details.
Could I suggest making the installation instructions a little clearer. TO me, they say: enter the Consumer key and Consumer secret, click the button and then follow the instructions — which implies that the other two fields should somehow be filled in later.
Forum: Plugins
In reply to: [BuddyPress Activity Plus] Deleting activity does not delete uploaded imagesThink this does what I was asking for, if anyone else is interested:
function delete_activity_images( $args ) { // This function is designed to delete images added by // BuddyPress Activity Plus (BPAP), so we first check for the constant // which defines the path to uploaded images. // If its not there, assume we use the default value if (!defined('BPFB_BASE_IMAGE_DIR')) { define('BPFB_BASE_IMAGE_DIR', $wp_upload_dir['basedir'] . '/bpfb/', true); } // Get the contents of the activity we are about to delete global $wpdb; $content = $wpdb->get_var( $wpdb->prepare( "SELECT content FROM ".$wpdb->prefix."bp_activity WHERE id = %d;", $args['id'] ) ); if ($content != '') { // Look for the shortcode surrounding image filenames uploaded the BPAP $matches = array(); preg_match('/\[bpfb_images\](.*?)\[\/bpfb_images\]/s', $content, $matches); // If there are any images, delete each one and its thumbnail if ($matches) { foreach ($matches as $match) { $images = array(); $images = explode('\n', trim(strip_tags($match))); if (!empty($images)) { foreach ($images as $image) { unlink(BPFB_BASE_IMAGE_DIR.$image); $image_fn = substr($image, 0, strrpos($image, '.')); $image_ext = substr($image, strrpos($image, '.') + 1); unlink(BPFB_BASE_IMAGE_DIR.$image_fn.'-bpfbt.'.$image_ext); } } } } } } add_action( 'bp_before_activity_delete', 'delete_activity_images');Any suggestions on improving efficiency would be very welcome.
Forum: Plugins
In reply to: [Breadcrumbs Everywhere] Lowercase titles for some breadcrumbsI see from the changelog of the latest version that you’ve now added title case. Thanks.
I suddenly realised that the achievements page is a sub-page of the author page … I had disabled author archives with WordPress SEO by Yoast. This, in effect, redirects any URL with
/author/in it back to the homepage.I re-enabled the archives and, voila, the blue button worked and the redirect loop was no more. So, TMJ31, maybe you have also disabled author archives?
The bad news is, I quite liked having author archives disabled, since my site isn’t about authors, it’s about members. (So I’m about to read up more about BP integration with Achievements.)
Hi,
I just tried out Achievements and experienced the same problems as initially described by TMJ31:
Achievement box pops up, but attempting to click the blue button, or manually typing in a different site URL in the browser address bar, does not make the box go away.
I can provide debugging info if you like, to help find the common thread between TMJ31’s setup and mine!
Best,
David