gojsse
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Query posts based on if has post thumbnailI had no idea the thumbnail data was stored in a meta field
Forum: Fixing WordPress
In reply to: Query posts based on if has post thumbnailI’m only querying for 4 posts so if I skip one after the main query then I will be left with only 3 posts.
I did find something out though, wp stores the thumbnail in a meta field so you can simply add this to the query: ‘meta_key’ => ‘_thumbnail_id’
Here’s my example:
$args = array ( 'numberposts' => 4, 'post_type' => 'slide', 'meta_key' => '_thumbnail_id', 'orderby' => 'date', 'order' => 'DESC' );Tested it and it works! Queries post type of ‘slide’ and skips any that don’t have a thumbnail attached.
I had the same issue on hierarchical taxonomies. It had something to do with how I was declaring my custom post type classes. After I put this into my functions.php rather than in a separate file the categorical taxonomy worked. also, the post categories didn’t work either until I moved this into functions.php:
add_action( 'init', 'registerCustomPostTypes' ); function registerCustomPostTypes() { global $cpt_event; global $cpt_attraction; $cpt_event = new CPTevents(); $cpt_attraction = new CPTattractions(); }The CPTevents and CPTattractions are my custom post type classes.
I’m not too sure why this worked, maybe I had one too many <?php ?> tags floating around and my tactic worked. I’m not sure about your issue though. You figure it out?
My workaround is just for adding another link after the events page link so it looks and acts more like you are viewing a single post.
Example, without the workaround, the breadcrumbs would do this even if you are viewing a single event:
home >> events
The code I made simply adds the currently viewed event at the end like this:
home >> events >> currently viewed event name
So, it doesn’t address the search portion nor does it hook into any functions for yoast or events manager.
No, it’s purely for customizing your yoast breadcrumbs to work with events manager a little better.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] remove#9 on this list is how to get around wp adding <p></p> through autoformatting in the tinymce:
You must have yoast seo and events manager installed.
Set your Home and breadcrumb separator in the Yoast internal links setting page.
Alright! thanks.
I used
global $EM_Event; if ( em_is_event_page() ) { //do stuff to append single event nav } elseif ( em_is_events_page() ) { //do stuff to append events list nav } else { //must not be an event(s) page so do yoast breadcrumb function }Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] removeYeah, that’s weird. I just styled the p tags outside of my content to not show. thanks.
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] removeOooops. got the wordpress version wrong, I put in the plugin version. The wp version I’m on is 3.1
Forum: Plugins
In reply to: [Vote It Up] [Plugin: Vote It Up] Show Like and DislikeI was wondering this too then I saw in the control panel for the plugin where it asks what text or img your want for positive votes a section also for negative votes.
It says if you leave the negative text or img to be displayed blank then:
If this is left blank two-way voting is disabled.Put something in that field and up down voting will be enabled.
Forum: Fixing WordPress
In reply to: [Plugin: Custom Field Template] Only future dates to choose?I was confused where to put startDate then it made sense moments later. Here’s an example of it in use:
[begins]
type = text
size = 35
date = true
dateFormat = yyyy-mm-dd
startDate = ‘2000/01/01’
label = Start date: YYYY-MM-DD Format (ex: 2009-11-02)Thanks for adding this functionality!
oops,
Ok, so that last bit of code on my post should be
//get the custom field value from this post and key cd_mp3_1 $temp = get_post_meta ($post->ID, 'cd_mp3_1', true); $shortcode_temp = "[audio: '".$temp."']"; //pass $shortcode_temp as argument of function do_shortcode echo do_shortcode($shortcode_temp);assuming the user simply input Voices.mp3 into the custom field called cd_mp3_1 instead of the full shortcode. I’d like to keep all code out of the custom fields as much as possible to simplify things for the user.
also, I tried
echo do_shortcode('[gigpress_archive]');
to makes sure I was doing everything right and the gigpress plugin shortcode output correctly on my category template.