התגובות שלי בפורום
-
מאתתגובות
-
nuriel hatav
Participantתנו לי בינתיים כיוון איפה לערוך את הקוד.
nuriel hatav
Participantתגובה זו סומנה כפרטית.nuriel hatav
Participantהשאלה עכשיו, איך אני יוצר טמפלייט רק ל loop עצמו כמו שבטמפלייטים שלכם, בלי לגעת ב header ו- footer?
nuriel hatav
Participantהבעיה נפתרה, get_template_part() קורה קובץ משורש תיקיית התבנית ולא מ מתיקיה content כמו pojo_get_content_template_part.
nuriel hatav
Participantתגובה זו סומנה כפרטית.nuriel hatav
Participantתודה.
28/03/2016 בשעה 00:20 בתגובה ל: תצוגת מוצרים – גודל תמונה, מספר מוצרים בשורה וסכ"ה מוצרים לעמוד #50386nuriel hatav
Participantתודה.
nuriel hatav
Participantטוב הבעיה נפתרה, מסתבר שבתוך תוסף צריך לעשות איניט לקריאת פונקציה:
add_action('init', array($this, 'setAll'));
במקום
$this->setAll();nuriel hatav
Participantזו השגיאה שמקבים אם אני קורא ל setAll() או ל getSide() מהשורטקוד:
Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method Architect::getSide() should not be called statically in /home/oricoil/public_html/roofdagan1/wp-includes/shortcodes.php on line 326 Fatal error: Using $this when not in object context in /home/oricoil/public_html/roofdagan1/wp-content/plugins/architects/architects.php on line 85nuriel hatav
Participant1) העפתי
2) החלפתי
3) Fatal error: Call to undefined function is_user_logged_in() in /home/oricoil/public_html/roofdagan1/wp-includes/query.php on line 3174nuriel hatav
Participantבקיצור:
What prevent WP_Query() to work inside class method? class MyClass { function __construct() { $this->myFunc(); // not work } public function myFunc() { global $post, $wp_query; $args_ = array( 'post_type' => 'post', 'posts_per_page' => -1, /*'meta_key' => 'mycustomfield',*/ /*'meta_value' => 1,*/ 'suppress_filters' => false ); $the_query = new WP_Query( $args_ ); // פה התוכנית נכשלת <-------- /*...*/ } }nuriel hatav
Participantעכשיו זה הצליח תודה.
nuriel hatav
Participantבעיה דומה
nuriel hatav
Participantמותקן רק Add Admin CSS, Zia3-JS-CSS, שכפול פוסט
ניסיתי לכבות את שלושתם והבעיה לא נפתרה.nuriel hatav
ParticipantWordpress 4.4.1
Poza 1.1.0
Woocommerce 2.5.1nuriel hatav
Participantוגם נעלם תפריט מובייל, זה כבר פעם 3-4 שזה קורא עם התבניות שלכם, פשוט בלי סיבה נעלמים אייקון סל קניות בתפריט, תפריט מובייל ופונט מיוחד של ערכת עיצוב.
nuriel hatav
Participantתודה רבה.
nuriel hatav
Participantסיידבר צדדי ראשי.

nuriel hatav
Participantהפלאגין לא זורק את הוידג'ט בשום מקום, הפלאגין פשוט עושה רגיסטר לוידג'ט כמו כל וידג'ט אחר.
// Register and load the widget function cpf_load_widget() { register_widget( 'cpf_widget' ); } add_action( 'widgets_init', 'cpf_load_widget' );nuriel hatav
Participantתיקון, למעשה זהו וידג'ט בתוך פלאגין, כלומר יצרתי פלאגין חדש, הפעלתי אותו והכנסתי וידג'ט בתוך הקוד של הפלאגין.
nuriel hatav
Participantלא, מיקמתי את הקוד בתוך וידג'ט:
<?php /* Plugin Name: custom-post-field Description: custom-post-field */ // Creating the widget class cpf_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of your widget 'cpf_widget', // Widget name will appear in UI __('CPF Widget', 'cpf_widget_domain'), // Widget description array( 'description' => __( 'Custom Post Field Widget', 'cpf_widget_domain' ), ) ); } // Creating widget front-end // This is where the action happens public function widget( $args, $instance ) { global $post, $wp_query, $post_inloop_id; $title = apply_filters( 'widget_title', $instance['title'] ); // before and after widget arguments are defined by themes echo $args['before_widget']; if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; $current_post = get_queried_object(); $post_id_ = $current_post ? $current_post->ID : null; //$post_id = $post_inloop_id; $bulet = "<i class=\"fa fa-check-circle\"></i>"; $resoult_ = "<ul class=\"post-custom-fields\">"; $fields = get_fields($post_inloop_id); /*print "<div style=\"text-align: left\">"; print "autlog:<br>"; print "get_queried_object()->ID = <br>".$post_id_."<br>"; print "the_ID() = <br>"; the_ID(); print "<br>"; print "get_the_ID() = <br>".get_the_ID()."<br>"; print "post->ID = <br>".$post->ID."<br>"; print "get_the_ID() = <br>".get_the_ID()."<br>"; print "wp_query->post->ID = <br>".$wp_query->post->ID."<br>"; print "</div>";*/ if( $fields ) { foreach( $fields as $field_name => $value ) { // get_field_object( $field_name, $post_id, $options ) // - $value has already been loaded for us, no point to load it again in the get_field_object function $field = get_field_object($field_name, $post_id, array('load_value' => false)); $type = $field['type']; $finishing = ""; if($type == "true_false") { $finishing .= "<li class=\"post-custom-field\">"; $checked = $value == 1 ? "checked" : ""; $value = "<input name=\"". $field_name ."\" id=\"". $field_name ."\" class=\"css-checkbox\" type=\"checkbox\" ". $checked ."><label onclick=\"return false;\" class=\"css-label\" for=\"". $field_name ."\">". $field['label'] ."</label>"; } else if($field_name == "project_youtube") { if($value == "") { continue; } $finishing .= "<li class=\"post-custom-field post-custom-field-youtube\">"; $value = "<a href=\"".$value."\">". $field['label'] ."</a>"; } else if($field_name == "project_date_of_construction") { $value = preg_replace('/^.*(\d{2})(\d{2})(\d{4})$/', '$1/$2/$3', $value); $finishing .= "<li class=\"post-custom-field\">"; $finishing .= "<div class=\"post-custom-field-title\">". $bulet ." ". $field['label'] ."</div>"; } else { $finishing .= "<li class=\"post-custom-field\">"; $finishing .= "<div class=\"post-custom-field-title\">". $bulet ." ". $field['label'] ."</div>"; } $finishing .= "<div class=\"post-custom-field-content\">". $value ."</div>"; $finishing .= "</li>"; $resoult_ .= $finishing; } } $resoult_ .= "</ul>"; // This is where you run the code and display the output echo __( $resoult_, 'cpf_widget_domain' ); echo $args['after_widget']; } // Widget Backend public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; } else { $title = __( 'New title', 'cpf_widget_domain' ); } // Widget admin form ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> </p> <?php } // Updating widget replacing old instances with new public function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; return $instance; } } // Class cpf_widget ends here // Register and load the widget function cpf_load_widget() { register_widget( 'cpf_widget' ); } add_action( 'widgets_init', 'cpf_load_widget' ); ?>שורה 35-55
nuriel hatav
Participantהאם ב Border יש תמיכה בפורמטים?
nuriel hatav
Participantהאם מצאתם תבעיה? אני לא יודע אם להמשיך לפתח את האתר או להתחיל מהתחלה מהתקנה חדשה.
nuriel hatav
Participantתגובה זו סומנה כפרטית.nuriel hatav
Participantלא זה ולא זה. פשוט הבחנתי בזה אחרי שינוי לוגו ועריכת סליידר.
-
מאתתגובות
