Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • in reply to: custom post type taxonomy #720
    ジョンジョン
    Participant

    Please tell me the code to add a term to the widget.

    in reply to: custom post type taxonomy #714
    ジョンジョン
    Participant

    It is a very good plugin so please make it a widget that can be filtered by term.

    in reply to: custom post type taxonomy #713
    ジョンジョン
    Participant

    Widget to expand.

    class WtiRecentlyLikedPostsWidget extends WP_Widget

    class WtiRecentlyLikedPostsWidget extends WP_Widget

    I want expend widget to taxonomy term.

    ex…..

    ◎post type → post
    ◎post type → custom post type

    ◎category → category_name
    × category → term

    I want to be able to acquire terms

    ————————————————–
    php7
    wordpress4.9
    Custom Post Type UI
    ————————————————–

    how to

    1 functions.php overwrite
    if can not
    2 wti-like-post-widgets.php edit

    in reply to: custom post type taxonomy #712
    ジョンジョン
    Participant
    in reply to: custom post type taxonomy #707
    ジョンジョン
    Participant


    Add this way to functions.php, but what is wrong?

    in reply to: custom post type taxonomy #706
    ジョンジョン
    Participant
                <?php
            }
     
            public function add_taxonomy_dropdown_args( $cat_args ) {
                $cat_args['taxonomy'] = $this->taxonomy;
                return $cat_args;
            }
     
            private function get_taxonomies() {
                $taxonomies = get_taxonomies( array(
                    'public' => true,
                ) );
                return $taxonomies;
            }
        }
        unregister_widget( 'WtiMostLikedPosts' );
        register_widget( 'WtiMostLikedPosts_Taxonomy' );
    }
    add_action( 'widgets_init', 'override_WtiMostLikedPosts' );
    in reply to: custom post type taxonomy #705
    ジョンジョン
    Participant
               <p>
                    <label for="<?php echo $this->get_field_id( 'taxonomy' ); ?>"><?php _e( 'Taxonomy:' ); ?></label><br />
                    <select id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>">
                        <?php foreach ( $taxonomies as $value ) : ?>
                        <option value="<?php echo esc_attr( $value ); ?>"<?php selected( $taxonomy, $value ); ?>><?php echo esc_attr( $value ); ?></option>
                        <?php endforeach; ?>
                    </select>
                </p>
    in reply to: custom post type taxonomy #704
    ジョンジョン
    Participant
            public function form( $instance ) {
                parent::form( $instance );
                $taxonomy = 'category';
                if ( !empty( $instance['taxonomy'] ) ) {
                    $taxonomy = $instance['taxonomy'];
                }
                $taxonomies = $this->get_taxonomies();
                ?>
    in reply to: custom post type taxonomy #703
    ジョンジョン
    Participant
                add_filter( 'widget_categories_dropdown_args', array( $this, 'add_taxonomy_dropdown_args' ), 10 );
                add_filter( 'widget_categories_args', array( $this, 'add_taxonomy_dropdown_args' ), 10 );
                parent::widget( $args, $instance );
            }
     
    in reply to: custom post type taxonomy #702
    ジョンジョン
    Participant
    
    function override_WtiMostLikedPostsWidget() {
        class WtiMostLikedPosts_Taxonomy extends WtiMostLikedPosts {
            private $taxonomy = 'category';
     
            public function widget( $args, $instance ) {
                if ( !empty( $instance['taxonomy'] ) ) {
                    $this->taxonomy = $instance['taxonomy'];
                }
    
    in reply to: custom post type taxonomy #701
    ジョンジョン
    Participant

    check
    wti-like-post-site.php

    
    	// Getting the most liked posts
    	$query = "SELECT post_id, SUM(value) AS like_count, post_title, post_author FROM <code>{$wpdb->prefix}wti_like_post</code> L, {$wpdb->prefix}posts P ";
    	$query .= "WHERE L.post_id = P.ID AND post_status = 'publish'";
    	
    	// Get the posts for specific post type
    	if(isset($args['post_type']) && !empty($args['post_type'])) {
    		$post_type = trim($args['post_type']);
    		$query .= " AND P.post_type IN ('" . str_replace(",", "','", $post_type) . "')";
    	}
    
    	

    I want to know the code to add a taxonomy input form with this widget.

    in reply to: custom post type taxonomy #700
    ジョンジョン
    Participant

    l

    There is a contributor before. There is always a need. Waiting for your answer.

    in reply to: Deprecated: Methods with the same name #657
    ジョンジョン
    Participant
    in reply to: Deprecated: Methods with the same name #655
    ジョンジョン
    Participant

    Can you get the latest version?

    in reply to: Deprecated: Methods with the same name #654
    ジョンジョン
    Participant

    change email please check me

Viewing 15 posts - 1 through 15 (of 20 total)