jbo.ciel
Forum Replies Created
-
Forum: Hacks
In reply to: custom page in php to update multiple postsThank you bcworkz for your answer.
I try to use update_post_meta() like this:
//wp_update_post( $post ); update_post_meta( $post_ID, 'chapo', $post['chapo'] );
… and nothing happen.
I am still investigating.
Hello,
I make some tests without any success.
I have a look at \inc\core\assets.php:
wp_register_style( 'font-awesome', plugins_url( 'assets/css/font-awesome.css', SU_PLUGIN_FILE ), false, '3.2.1', 'all' );
In my template i use into function.php:
wp_enqueue_style( 'twentytwelve-genericons', get_template_directory_uri() . '/genericons.css' );
When i check \inc\core\shortcodes.php, i am wondering if i could load my icon font like that:
su_query_asset( 'css', 'font-awesome', 'twentytwelve-genericons');
But i don’t. Any idea to get something like that. Do i modify the function register ()?
Thank you for an clue,
jbForum: Plugins
In reply to: [Wp-Pro-Quiz] Result based on most A, B, C, D or E answers?Thank you bluetaildesigns for your answer.
Maybe another quiz type in WP Pro Quiz could help but i don’t have the time to try it for now.
Nevermind, WP Pro Quiz stay a good plugin.
jBForum: Plugins
In reply to: [Event Organiser] Use event post with YARPPHello,
I found a way on a blog to add all custom posts:
function add_yarpp_support_to_post_types($post_type, $args) { global $wp_post_types; $args->yarpp_support = true; $wp_post_types[$post_type] = $args; } add_action('registered_post_type', 'add_yarpp_support_to_post_types', 10, 2);
So i close the topic for know.
jB
Forum: Hacks
In reply to: Image caption // add attribute to imgHello bcworkz,
I got it!
First of all, i made a small step this morning: the problem which break the code was not due to the post type. But it was conditioned by the thumbnail presence, as my variables $description and $title use the thumbnail id.
So i work on the attachment id and finally, i get this code which work perfectly in all the situations i tested:
add_filter( 'img_caption_shortcode', 'cleaner_caption', 10, 3 ); if ( !function_exists('cleaner_caption')) { function cleaner_caption( $output, $attr, $content ) { /* We're not worried abut captions in feeds, so just return the output here. */ if ( is_feed() ) return $output; /* Set up the default arguments. */ $defaults = array( 'id' => '', 'align' => '', 'width' => '', 'caption' => '' ); /* Merge the defaults with user input. */ $attr = shortcode_atts( $defaults, $attr ); $attachment = preg_split( "/_/", esc_attr( $attr['id'] ) ); // Return attachment_xxx $attachment_id = $attachment[1]; /* If the width is less than 1 or there is no caption, return the content wrapped between the [caption]< tags. */ if ( 1 > $attr['width'] || empty( $attr['caption'] ) ) return $content; /* Set up the attributes for the caption. */ $attributes = ( !empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '' ); $attributes .= ' class="wp-caption ' . esc_attr( $attr['align'] ) . '"'; $attributes .= ' style="width: ' . esc_attr( $attr['width'] ) . 'px"'; /* Open the caption <div>. */ $output = '<figure' . $attributes .'>'; /* Allow shortcodes for the content the caption was created for. */ $output .= do_shortcode( $content ); /* Add information to the $output. */ $description = get_post($attachment_id)->post_content; $title = get_post($attachment_id)->post_title; if ( get_featured_image_copyright() != '© ' ) { $copyright = get_featured_image_copyright($attachment_id); } else { $copyright = $title; }; $output = str_replace( '></a>','description="'.$description.'" title="'.$copyright.'" title-meta="'.$title.'"></a>',$output); /* Append the caption text. */ $output .= '<figcaption class="wp-caption-text">' . $attr['caption'] . '</figcaption>'; /* Close the caption. */ $output .= '</figure>'; $output .= '<p class="wp-description-text">'.$description.'</p>'; /* Return the formatted, clean caption. */ return $output; } } //endif !function_exists
That’s all.
Thank you for your helpful answers.
jB
Forum: Hacks
In reply to: Image caption // add attribute to imgThank you Bcworkz for your answer.
I think about it this afternoon.
Actually, preg_replace() doesn’t change anything. On the contrary.I conclude the issue came from this code:
$description = get_post(get_post_thumbnail_id())->post_content; $title = get_post(get_post_thumbnail_id())->post_title;
These variables call the information from the post and not for the attachment added into the caption.
So i make a test with other information like _wp_attachment_image_alt:
$attachment_id = get_post_thumbnail_id(); $description = get_post_meta($attachment_id, '_wp_attachment_image_alt', true)
No success.
I am still looking for a solution.
I try all the solutions i read and google results seems to be exhausted. I begin to think the caption <img> code is perfect for everybody…jB
Forum: Plugins
In reply to: [Event Organiser] Display Map // Image not fully loading not centeringHello Stephen,
I have just got the time to rework on this issue…
On the contrary to the first thoughts, it was not a javascript problem or a theme conflict… But a css one.Actually, i had this into my style.css:
img { background: none repeat scroll 0 0 #F5F5F5; border: 0 none; }
So i just overwrite it with this:
.eo-event-meta img { background:inherit; }
And it solve the issue.
Thank you for this plugin.
jBForum: Plugins
In reply to: [Event Organiser] Multi custom fields for venuesHello Stephen,
Sorry for this omission.
Thank you for your help.Here is my final code:
add_action('add_meta_boxes','eo_custom_add_metabox'); function eo_custom_add_metabox(){ add_meta_box('eo_custom_metabox','Informations complémentaires', 'eo_custom_metabox_callback', 'event_page_venues', 'side', 'high'); } function eo_custom_metabox_callback( $venue ){ //Metabox's innards: $_venue_phone = eo_get_venue_meta($venue->term_id, '_venue_phone',true); $_venue_url = eo_get_venue_meta($venue->term_id, '_venue_url',true); $_venue_facebook = eo_get_venue_meta($venue->term_id, '_venue_facebook',true); $_venue_googleplus = eo_get_venue_meta($venue->term_id, '_venue_googleplus',true); $_venue_twitter = eo_get_venue_meta($venue->term_id, '_venue_twitter',true); //Remember to use nonces! wp_nonce_field('eo_custom_venue_meta_save', 'eo_custom_plugin_nonce_field' ); ?> <label> Téléphone:</label> <i class="howto">avec l'indicatif: +33 pour la France</i> <input type="text" name="eo_custom_venue_phone" value="<?php echo esc_attr($_venue_phone);?>" > <br/> <br/> <label> Website:</label> <i class="howto">https://www.exemple.fr</i> <input type="text" name="eo_custom_venue_url" value="<?php echo esc_attr($_venue_url);?>" > <br/> <br/> <label> Facebook profile URL:</label> <i class="howto"></i> <input type="text" name="eo_custom_venue_facebook" value="<?php echo esc_attr($_venue_facebook);?>" > <br/> <br/> <label> Google+:</label> <i class="howto"></i> <input type="text" name="eo_custom_venue_googleplus" value="<?php echo esc_attr($_venue_googleplus);?>" > <br/> <br/> <label> Identifiant Twitter:</label> <i class="howto">sans le @</i> <input type="text" name="eo_custom_venue_twitter" value="<?php echo esc_attr($_venue_twitter);?>" > <?php } add_action ('eventorganiser_save_venue','eo_custom_save_venue_meta'); function eo_custom_save_venue_meta( $venue_id ){ //If our nonce isn't present just silently abort. if( !isset( $_POST['eo_custom_plugin_nonce_field'] ) ) return; //Check permissions $tax = get_taxonomy( 'event-venue'); if ( !current_user_can( $tax->cap->edit_terms ) ) return; //Check nonce check_admin_referer( 'eo_custom_venue_meta_save', 'eo_custom_plugin_nonce_field' ); //Retrieve meta value(s) $value1 = $_POST['eo_custom_venue_phone']; $value2 = $_POST['eo_custom_venue_url']; $value3 = $_POST['eo_custom_venue_facebook']; $value4 = $_POST['eo_custom_venue_googleplus']; $value5 = $_POST['eo_custom_venue_twitter']; //Update venue meta eo_update_venue_meta($venue_id, '_venue_phone', $value1); eo_update_venue_meta($venue_id, '_venue_url', $value2); eo_update_venue_meta($venue_id, '_venue_facebook', $value3); eo_update_venue_meta($venue_id, '_venue_googleplus', $value4); eo_update_venue_meta($venue_id, '_venue_twitter', $value5); return; }
Forum: Plugins
In reply to: [Wp-Pro-Quiz] Result based on most A, B, C, D or E answers?Hello,
Finaly nobody get a solution at Vulture345’s original question?
@bluetaildesigns did you find an alternative solution?
Thank for any help,
jBForum: Plugins
In reply to: [Archives Calendar Widget] translationBonjour Alek,
Merci pour votre réponse et pour ce plugin.
Pour information, en ce qui concerne le site, je crois qu’il tourne sur windows server. L’utilisation de fichiers de traduction sera dans tous les cas utile pour la popularité du plugin.
Du coup, je ferme le ticket en attendant une prochaine version.
Bonne journée,
jbForum: Plugins
In reply to: [Event Organiser] Single day event // add not displayThank you Stephen, it solved the issue.
To sum up, here is the code i use:
<!-- Single event --> <div class="eo-event-meta-date"> <div class="icon"></div> <?php $occurrences = eo_get_the_occurrences_of( $post_id ); foreach( $occurrences as $occurrence) { $start_date = eo_format_datetime( $occurrence['start'] , 'j F Y' ); $start_time = eo_format_datetime( $occurrence['start'] , get_option('time_format') ); $end = eo_format_datetime( $occurrence['end'] , 'jS F ga' ); printf( '<strong>Date:</strong> %s<br/>', $start_date ); printf( '<strong>Heure:</strong> %s<br/>', $start_time ); }; ?> </div>
I close this topic.
jb
Forum: Plugins
In reply to: [Event Organiser] Display Map // Image not fully loading not centeringHello Stephen,
I will investigate more until now i don’t notice any js error with firebug. The theme conflict is going to be an interesting way.
I will post if i found something interesting.
Thank you for your interest,
jBForum: Plugins
In reply to: [Event Organiser] Single day event // add not displayHello Stephen,
Thank you for your reply.
To display those date, i modified a copy of event-meta-event-single.php into my template, as followed:
For reoccurenced date, it works:
<?php //Event reoccurs - display dates. $upcoming = new WP_Query(array( 'post_type'=>'event', 'event_start_after' => 'today', 'posts_per_page' => -1, 'event_series' => get_the_ID(), 'group_events_by'=>'occurrence'//Don't group by series )); if( $upcoming->have_posts() ): ?> <div class="eo-event-meta-date"> <div class="icon"></div> <strong><?php _e('Prochaines Dates','eventorganiser'); ?></strong><br/> <span id="eo-upcoming-dates"> <?php while( $upcoming->have_posts() ): $upcoming->the_post(); ?> <?php eo_the_start('j F Y'); ?> <small>à <?php eo_the_start(get_option('time_format')); ?></small><br/> <?php endwhile; ?> </span> </div> <?php wp_reset_postdata(); //With the ID 'eo-upcoming-dates', JS will hide all but the next 5 dates, with options to show more. wp_enqueue_script('eo_front'); ?> <?php endif; ?>
For single day event, it doesn’t work:
<div class="eo-event-meta-date"> <div class="icon"></div> <strong><?php _e('Date', 'eventorganiser') ;?>:</strong> <?php eo_the_start('j F Y'); ?><br/> <strong><?php _e('Heure', 'eventorganiser') ;?>:</strong> <?php eo_the_start(get_option('time_format')); ?><br/> </div>
Hope it will give you some clues.
jBForum: Plugins
In reply to: [Event Organiser] Empty Start/End Date Columns in the backendHello Stephen,
It was just a misconfiguration.
The calendar widget works perfectly.I just have a problem to add the event custom post type to the main loop.
I use this function you suggest in another post (here):function add_event_type_to_query($query){ if( $query->is_main_query() && is_front_page() && in_array( 'event-organiser/event-organiser.php' , get_option('active_plugins') ) ){ $query->set('post_type', array('post','event')); } } add_action('pre_get_posts','add_event_type_to_query',5,1);
The result is the google map functions are disable (the map is shown without any functionnality) and i don’t get date informations for single day events. It’s strange because the occurences dates are perfectly displayed. All type of events are perfectly displayed on the events’ pages (tag, category, single, venue, date).
I will investigate a little deeper (maybe i should change the way to add events to the loop, and i will open a new topics if i don’t find the solution.
Thank you for your help.
jBForum: Plugins
In reply to: [Event Organiser] Empty Start/End Date Columns in the backendHello Stephen,
Thank you for your answer.
Finally i solve it using this function:in_array( 'event-organiser/event-organiser.php' , get_option('active_plugins') )
Il clarify the problem with is_plugin_active was born when i remove the plugin adminimize. I guess this plugin add this function for temlate use…
Only stay some customizations with the calendar widget (for exemple, for a reoccurent events, it only show the first next date and not all the date), and it will be ready.
Otherwise, the update solve the problem with the translation.
Thank you for your work.
I close the topic.jB