התגובות שלי בפורום
-
מאתתגובות
-
היי בועז,
הנה לינק שפועל לדוגמאאשמח אם תוכל להכווין אותי איפה הנמצא ה jquery / javascript שעלי לערוך?
28/03/2016 בשעה 11:47 בתגובה ל: עריכת גודל התמונות ב pojo 'products by category' builder widget #50392הוידג'ט שהתכוונתי אליו הוא:
woo product by category שנמצא בבילדרהשאלה היא היכן ממוקם קובץ העריכה שלו כדי שאוכל להגדיר את סוג התמונה שהוא מביא
החלטתי בסוף ליצור טופס דרך התוסף עצמו..
תודה על התגובהתודה המדריך עובד!
עם זאת עדין יש מספר משפטים שלא תורגמו שהייתי רוצה לתרגם בעצמי לדוגמא:
"חוות דעתאין עדיין חוות דעת.
BE THE FIRST TO REVIEW “חגורת עור מעוצבת”"
לאחר שהעליתי את הקבצים והתרגום נקלט נכנסתי לקובץ woocommerce-he_IL.po ואתרתי את השורה:
#: templates/single-product-reviews.php:68 msgid "Be the first to review “%s”" msgstr ""
הכנסתי לתוכה תרגום ידני שלי:
#: templates/single-product-reviews.php:68 msgid "Be the first to review “%s”" msgstr "היו הראשונים לרשום חוות דעת על “%s”"
שמרתי כמובן את העדכון שבצעתי.
כשאר חזרתי לאתר ורעננתי את הדף (Ctrl +f5) ראיתי שהתרגום שלי לא נקלט..האם עשיתי משהו לא נכון?
שלום נועה,
אכן שדרגתי אתמול את התבנית ל 2.5 וממה שאני רואה אין את קבצי התרגום הנ"ל לא ב:
wp-content/languges/plugins
ולא ב woocommerce/i18n/langugesאשמח לעזרה בדחיפות..
בברכה,
דניאלאני יודע קצת קוד ויש לי גישה לשרת.
אולי תוכלי לעזור ולהכווין אותי איזה קובץ עלי לערוך ואיזו שורת קוד לשנות?בברכה,
דניאלאחלה הכנסתי, הwarning ירד 🙂
אבל ה taxonomy_terms עדין לא מוצגים..אולי בגלל הצורה שבה הגדרתי אותם?
// Add Pojo builder to posts function pojo_add_builder_in_posts() { add_post_type_support( 'post', array( 'pojo-page-format' ) ); } add_action( 'init', 'pojo_add_builder_in_posts' ); // WP trips Categories function build_taxonomies() { register_taxonomy( 'categories', 'trips', array( 'hierarchical' => true, 'label' => 'קטגוריות טיולים', 'query_var' => true, 'rewrite' => true ) ); } add_action( 'init', 'build_taxonomies', 0 ); // Add Pojo trips to smart page function pojo31106_add_post_type_to_smart_page( $post_types = array() ) { $post_types[] = 'trips'; return $post_types; } add_filter( 'pf_format_content_list', 'pojo31106_add_post_type_to_smart_page' ); // Add filters to trips smart page function pojo31106_smart_page_add_fields( $fields = array() ) { $cpt = 'trips'; $fields[] = array( 'id' => 'content', 'type' => Pojo_MetaBox::FIELD_HIDDEN, 'std' => $cpt, ); // If you want filter by Taxonomy //$fields[] = array( //'id' => 'taxonomy', //'type' => Pojo_MetaBox::FIELD_HIDDEN, //'std' => 'categories', //); $fields[] = array( 'id' => 'taxonomy_terms', 'title' => __( 'Choose Category', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_TAXONOMY_TERM_CHECKBOX, 'taxonomy' => 'categories', ); $fields[] = array( 'id' => 'display_type', 'title' => __( 'Select Content Layout', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_SELECT, 'options' => array( '' => __( 'Default', 'pojo' ), 'trips_three_columns' => __( 'גריד 3 עמודות', 'pojo' ), ), 'std' => '', ); // If you want to display Taxonomy $fields[] = array( 'id' => 'add_filter_by_category', 'title' => __( 'Add Filter By Category', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_SELECT, 'options' => array( '' => __( 'Show', 'pojo' ), 'hide' => __( 'Hide', 'pojo' ), ), 'std' => '', ); return $fields; } add_filter( 'pf_list_posts_cpt-trips', 'pojo31106_smart_page_add_fields' ); // display trips filters categories function pojo_before_content_loop( $display_type ) { if ( 'trips' !== atmb_get_field( 'content' ) || 'hide' === atmb_get_field( 'add_filter_by_category' ) ) return; $taxonomy_terms = atmb_get_field( 'taxonomy_terms', false, Pojo_MetaBox::FIELD_CHECKBOX_LIST ); if ( empty( $taxonomy_terms ) ) return; $terms = get_terms( 'categories', array( 'include' => $taxonomy_terms, ) ); if ( is_wp_error( $terms ) ) return; ?><ul class="category-filters"> <li><a href="javascript:void(0);" data-filter="*" class="active"><?php _e( 'All', 'pojo' ); ?></a></li> <?php foreach( $terms as $term ) : ?> <li><a href="javascript:void(0);" data-filter=".filter-term-<?php echo esc_attr( $term->term_id ); ?>"><?php echo $term->name; ?></a></li> <?php endforeach; ?> </ul><?php } add_action( 'pojo_before_content_loop', pojo_before_content_loop, 20 );
?
מחקתי, כך זה נראה כעת:
// display trips filters categories function pojo_before_content_loop( $display_type ) { if ( 'trips' !== atmb_get_field( 'content' ) || 'hide' === atmb_get_field( 'add_filter_by_category' ) ) return; $taxonomy_terms = atmb_get_field( 'taxonomy_terms', false, Pojo_MetaBox::FIELD_CHECKBOX_LIST ); if ( empty( $taxonomy_terms ) ) return; $terms = get_terms( 'categories', array( 'include' => $taxonomy_terms, ) ); if ( is_wp_error( $terms ) ) return; ?><ul class="category-filters"> <li><a href="javascript:void(0);" data-filter="*" class="active"><?php _e( 'All', 'pojo' ); ?></a></li> <?php foreach( $terms as $term ) : ?> <li><a href="javascript:void(0);" data-filter=".filter-term-<?php echo esc_attr( $term->term_id ); ?>"><?php echo $term->name; ?></a></li> <?php endforeach; ?> </ul><?php } add_action( 'pojo_before_content_loop' );
רק שעכשיו הוא צועק עלי ש
Warning: Missing argument 2 for add_action(), called in /home/coopflam/public_html/baobabtrips/wp-content/themes/titanium-child/functions.php on line 101 and defined in /home/coopflam/public_html/baobabtrips/wp-includes/plugin.php on line 457הסתכלתי שם וזה מה שרשום:
function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) { return add_filter($tag, $function_to_add, $priority, $accepted_args); }
שלי ותיקנתי את הפונקציה:
// Add Pojo trips to smart page function pojo31106_add_post_type_to_smart_page( $post_types = array() ) { $post_types[] = 'trips'; return $post_types; } add_filter( 'pf_format_content_list', 'pojo31106_add_post_type_to_smart_page' ); // Add filters to trips smart page function pojo31106_smart_page_add_fields( $fields = array() ) { $cpt = 'trips'; $fields[] = array( 'id' => 'content', 'type' => Pojo_MetaBox::FIELD_HIDDEN, 'std' => $cpt, ); // If you want filter by Taxonomy //$fields[] = array( //'id' => 'taxonomy', //'type' => Pojo_MetaBox::FIELD_HIDDEN, //'std' => 'categories', //); $fields[] = array( 'id' => 'taxonomy_terms', 'title' => __( 'Choose Category', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_TAXONOMY_TERM_CHECKBOX, 'taxonomy' => 'categories', ); $fields[] = array( 'id' => 'display_type', 'title' => __( 'Select Content Layout', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_SELECT, 'options' => array( '' => __( 'Default', 'pojo' ), 'trips_three_columns' => __( 'גריד 3 עמודות', 'pojo' ), ), 'std' => '', ); // If you want to display Taxonomy $fields[] = array( 'id' => 'add_filter_by_category', 'title' => __( 'Add Filter By Category', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_SELECT, 'options' => array( '' => __( 'Show', 'pojo' ), 'hide' => __( 'Hide', 'pojo' ), ), 'std' => '', ); return $fields; } add_filter( 'pf_list_posts_cpt-trips', 'pojo31106_smart_page_add_fields' ); // display trips filters categories public function pojo_before_content_loop( $display_type ) { if ( 'trips' !== atmb_get_field( 'content' ) || 'hide' === atmb_get_field( 'add_filter_by_category' ) ) return; $taxonomy_terms = atmb_get_field( 'taxonomy_terms', false, Pojo_MetaBox::FIELD_CHECKBOX_LIST ); if ( empty( $taxonomy_terms ) ) return; $terms = get_terms( 'categories', array( 'include' => $taxonomy_terms, ) ); if ( is_wp_error( $terms ) ) return; ?><ul class="category-filters"> <li><a href="javascript:void(0);" data-filter="*" class="active"><?php _e( 'All', 'pojo' ); ?></a></li> <?php foreach( $terms as $term ) : ?> <li><a href="javascript:void(0);" data-filter=".filter-term-<?php echo esc_attr( $term->term_id ); ?>"><?php echo $term->name; ?></a></li> <?php endforeach; ?> </ul><?php } add_action( 'pojo_before_content_loop', array( &$this, 'pojo_before_content_loop' ), 20 );
אבל עדין עדין מקבל…Parse error: syntax error, unexpected T_PUBLIC
🙁היי יקיר,
איתרתי את הפונקציה והוספתי ל functions.php באופן הבא:
public function pojo_before_content_loop( $display_type ) { if ( 'trips' !== atmb_get_field( 'po_content' ) || 'hide' === atmb_get_field( 'po_add_filter_by_category' ) ) return; $taxonomy_terms = atmb_get_field( 'po_taxonomy_terms', false, Pojo_MetaBox::FIELD_CHECKBOX_LIST ); if ( empty( $taxonomy_terms ) ) return; $terms = get_terms( 'categories', array( 'include' => $taxonomy_terms, ) ); if ( is_wp_error( $terms ) ) return; ?><ul class="category-filters"> <li><a href="javascript:void(0);" data-filter="*" class="active"><?php _e( 'All', 'pojo' ); ?></a></li> <?php foreach( $terms as $term ) : ?> <li><a href="javascript:void(0);" data-filter=".filter-term-<?php echo esc_attr( $term->term_id ); ?>"><?php echo $term->name; ?></a></li> <?php endforeach; ?> </ul><?php } add_action( 'pojo_before_content_loop', array( &$this, 'pojo_before_content_loop' ), 20 );
כמובן שקיבלתי:
Parse error: syntax error, unexpected T_PUBLICמה עשיתי לא נכון?
האם תהיה מוכן לעשות איתי חצי שעה team viewer ולעזור לי?
אשמח גם לשלם לך עבור העזרה.תודה על ההכוונה הצלחתי להכניס את ה key הנכון ולהציג את התוכן בצורה של גריד 3 עמודת כפי שרציתי.
ראיתי שבגלריות ניתן גם להחליט אם רוצים להציג פילטר של הקטגרויות:
הלכתי ל core/addons/galleries/classes/class-pojo-gallery-cpt.php
והצלחתי ליצור ב CPT 'trips' שליבאמצעות העתקת הקוד:$fields[] = array( 'id' => 'add_filter_by_category', 'title' => __( 'Add Filter By Category', 'pojo' ), 'type' => Pojo_MetaBox::FIELD_SELECT, 'options' => array( '' => __( 'Show', 'pojo' ), 'hide' => __( 'Hide', 'pojo' ), ), 'std' => '', );
הבעיה: אני כרגע לא מצליח להציג (בפרונט של הדף) את הפילטור לפי הקטגוריות היחודיות שיצרתי ל CPT שלי..
יצרתי את הקטגוריות באמצעות הוספת הקוד שלמטה ל functions.php:add_action( 'init', 'build_taxonomies', 0 ); function build_taxonomies() { register_taxonomy( 'categories', 'trips', array( 'hierarchical' => true, 'label' => 'קטגוריות טיולים', 'query_var' => true, 'rewrite' => true ) ); }
הייתי רוצה שיוצגו כפי שהן מוצגות בגלריות של פוגו':
תגובה זו סומנה כפרטית.תודה עובד לי עם ה css
שאלה שקשורה – כיצד מבטלים את הרקע האדום שעליו היה איקון ה"פלוס" כאשר עושים הובר לתמונה?
02/12/2015 בשעה 23:09 בתגובה ל: מדוע הלוגו שהעליתי לתבנית מוצג רק ב"סטיקי הידר" ובהידר הרגיל מוצג הטקסט הקודם? #39023הסתדרתי טנקס, אפשר לסגור
-
מאתתגובות