debsch
Forum Replies Created
-
And here’s an even better solution… (I scrapped the above one)
Forum: Plugins
In reply to: [Category Subscriptions] [Plugin: Category Subscriptions] Custom taxonomies?And it’s only working for immediate notifications not daily or weekly digests…. (yet)
So instead of using
echo EM_Events::output(array( 'format'=>'<B>#_EVENTLINK</B><br/> and all my custom php stuff here', 'limit'=>20, 'pagination'=>1));I’m now using
$args['format'] = "<B>#_EVENTLINK</B><br/> and all my custom php stuff here"; $args['limit'] = 20; // NO PAGINATION ARGS - USE THE DEFAULT BECAUSE THE DEFAULT WORKS echo EM_Events::output( $args );and YAY pagination is working.
FIXED! (for me anyway)
Ditto. Same problem… pagination does not work using EM_Events::output. Would hate to have to list 100s of events on one page…
Ever solved this problem?
I’m getting it too. Page 2, 3, 4 all go to page 1.
And I’m using events-list.phpForum: Plugins
In reply to: [Category Subscriptions] [Plugin: Category Subscriptions] Custom taxonomies?OOPS!
(edit)
change..
$categories = wp_get_post_categories($post->ID);
toif ( 'post' == get_post_type() ) { $categories = wp_get_post_categories($post->ID); ///// only works with POST types not CUSTOM POST types ////////// } else { $mycustomcategories = get_the_terms( $post->ID, 'event-categories' ); foreach( $mycustomcategories as $term ) { $categories [0] = $term->term_taxonomy_id; // Get rid of the other data stored in the object unset($term); } }Obviously still a very buggy solution.
Forum: Plugins
In reply to: [Category Subscriptions] [Plugin: Category Subscriptions] Custom taxonomies?Cracked it! I think.
What I’ve done is basically change the script to look for custom posts types instead of the regular POST.
Sooooo…
in wp-content/plugins/category-subscriptions/includes/category_subscriptions_class.phpfind & change
$categories = get_categories(array(...
to
$categories = get_categories(array('hierarchical' => 1, 'hide_empty' => 0, 'taxonomy' => 'my-custom-categories',));This line appears twice. I changed both lines and on my user profile I now have a list of my CUSTOM categories instead of the regular categories. THAT was the easy bit. It took me a while to figure out the rest.
find & change
'post_type' => 'post'
to
'post_type' => 'my-custom-post-type'And lastly (this took me HOURS to figure out… because I’m a noobie)
find & change
$categories = wp_get_post_categories($post->ID);
to$mycustomcategories = get_the_terms( $post->ID, 'my-custom-categories' ); foreach( $mycustomcategories as $term ) { $categories [0] = $term->term_taxonomy_id; // Get rid of the other data stored in the object unset($term); }… because
wp_get_post_categoriesONLY works with POSTS, so you have to useget_the_termsif you want to work with CUSTOM POSTS!After I did this I ran a test…
and I received an email from the Category Subscriptions plugin informing me of a CUSTOM POST! YAY!🙂
Forum: Fixing WordPress
In reply to: `wp_get_post_categories` equivalent for custom taxonomies?One step further…
(I’m just a noob so if this is wrong please be kind and correct me)
Using
wp_get_post_categories($post->ID)on a custom post type page just doesn’t work because it’s not a POST, it’s a custom post. So I want to find an equivalent to make a plugin work with custom post types.This is on a regular POSTS page…
$categories = wp_get_post_categories($post->ID); print_r ($categories);and outputs
Array ( [0] => 1 )
which is the same as$mycustomcategories = get_the_terms( $post->ID, 'my-custom-categories' ); foreach( $mycustomcategories as $term ) { $categories [0] = $term->term_taxonomy_id; // Get rid of the other data stored in the object unset($term); } print_r ($categories);which outputs
Array ( [0] => 3 )on my CUSTOM POST TYPE page.🙂
Forum: Fixing WordPress
In reply to: `wp_get_post_categories` equivalent for custom taxonomies?So I found out that by definition wp_get_POST_categories can only get POST categories not a custom post’s categories.
I need to use get_the_terms instead
$category = get_the_terms( $post->ID, 'custom-taxonomy-here' ); //////find custom taxonomy category name foreach ( $category as $cat){ echo $cat->name; }Forum: Fixing WordPress
In reply to: wp_get_post_categories($post->ID) – Category Names?THANK YOU DMOON79! Useful code – just what I needed!
Forum: Fixing WordPress
In reply to: Random Hashtag Strings Added to URL in Firefox?THANK YOU! I was also looking for a solution to this hashtag problem. My nice clean urls are back after following the above advice.
Using addthis instead.
Hi MattyRob, I did try that, working and testing using firefox & ie. I’ve not yet seen the unsubscribe button.
What I’ll do in the meantime (shame to let a little thing like that stop me using a fab plugin) is to add something like “If you want to unsubscribe please contact me, I’m a nice human being and I’ll take you off our list” and then manually unsubscribe people.
It’s a small site so I should be able to manage this manually via admin.
Thank you for the code!
global $mysubscribe2; $mysubscribe2->user_menu();I have been looking so long for this to move the notification settings back end options to the front end.
🙂