kopis.dev
Forum Replies Created
-
Forum: Plugins
In reply to: [WP-FlyBox] Wrong number of Twitter followersI did it and worked.
I will check next week if the issue has been resolved for good.
Thank you for your quick helpWe thought that we give a try and implement the idea of separate sidebars for each category on the production site and it worked.
What was the reason that was not working on the test site we do know yet.I will do and get to you
That is correct , I am interested in setting up custom sidebars for single post pages.
The concept is as follows:
We have various categories on our site with posts from different authors but under a single brand.
We want to those authors to post articles expressing their personal opinions , so we created a new category named “blogs” and the respective subcategories for each author as “blog-AuthorsName”.
the objective is to display a different sidebar – content with those posts from the posts in the rest of the site.
If I define a rule for the parent category “blogs” it works it terms that it shows the custom sidebar content in all subcategories.
But if I want to assign a custom sidebar to any of the subcategories o from the parent so that each author has it’s own sidebar it does not works and it displays the sidebar content assigned to the single posts
RegardsHello!
I apologize for not including the assorted rules for the side bars
Initially the first rule that I have set up for the parent category (“blogs”) was the following
https://www.screencast.com/t/M0HVLW1r
Then to expand it for the each category I deleted the above rule and created 4 separate ones for each subcategory as follows :
https://www.screencast.com/t/tnZP2ioBag
https://www.screencast.com/t/uUsa4VMy
https://www.screencast.com/t/507lmim9jZS
https://www.screencast.com/t/xZTsrPLyy9A
And I have also one rule for the rest of the single posts
https://www.screencast.com/t/bzcnKfzP7sp0
Thank you in advance
PeterScreen shots can be found at the following links :
Capture 1The rules are as follows
1 custom side bar for category Blog-Dennis Villiardos
1 custom side bar for category Blog-Vasilis Villiardos
and so on for the categories within the category “Blog”
also 1 custom sidebar for the rest of categories
The default sidebar applies only for the homepageThank you for your clarification
Forum: Plugins
In reply to: [Posts By Tag] insert post's tags into the function posts_by_tags($tags);<?php /*------------------------------------------*/ /* WPZOOM: Featured Category widget */ /*------------------------------------------*/ $wpzoomColors = array(); $wpzoomColors['blue'] = 'Blue'; $wpzoomColors['green'] = 'Green'; $wpzoomColors['pink'] = 'Pink'; $wpzoomColors['red'] = 'Red'; $wpzoomColors['black'] = 'Black'; class wpzoom_widget_category extends WP_Widget { /* Widget setup. */ function wpzoom_widget_category() { /* Widget settings. */ $widget_ops = array( 'classname' => 'wpzoom', 'description' => __('Featured Category Widget for Homepage', 'wpzoom') ); /* Widget control settings. */ $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'wpzoom-widget-cat' ); /* Create the widget. */ $this->WP_Widget( 'wpzoom-widget-cat', __('WPZOOM: Featured Category', 'wpzoom'), $widget_ops, $control_ops ); } /* How to display the widget on the screen. */ function widget( $args, $instance ) { extract( $args ); /* Our variables from the widget settings. */ $title1 = apply_filters('widget_title', $instance['title1'] ); $color1 = $instance['color1']; $posts1 = $instance['posts1']; $category1 = get_category($instance['category1']); if ($category1) { $categoryLink1 = get_category_link($category1); } $exclude_featured = $instance['exclude_featured']; /* Exclude featured posts from Widget Posts */ $postnotin = ''; if ($exclude_featured == 'on') { $featured_posts = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => option::get('featured_number'), 'meta_key' => 'wpzoom_is_featured', 'meta_value' => 1 ) ); while ($featured_posts->have_posts()) { $featured_posts->the_post(); global $post; $postIDs[] = $post->ID; } $postnotin = $postIDs; } /* Before widget (defined by themes). */ //echo $before_widget; $z = 0; while ($z < 1) { $z++; $color = "color$z"; $categoryLink = "categoryLink$z"; $title = "title$z"; $posts = "posts$z"; $category = $instance["category$z"]; ?> <div class="block"> <?php if ( $$title ) { echo '<h3 class="'.$$color.'"><a href="'.$$categoryLink.'">'.$$title.' »</a></h3> '; } ?> <?php $second_query = new WP_Query( array( 'cat' => $category, 'showposts' => $$posts, 'orderby' => 'date', 'post__not_in' => $postnotin, 'order' => 'DESC' ) ); $i = 0; if ( $second_query->have_posts() ) : while( $second_query->have_posts() ) : $second_query->the_post(); unset($image,$cropLocation); $i++; global $post; if ($i == 1) { ?> <div class="firstn"> <?php get_the_image( array( 'size' => 'featured-cat', 'width' => 235, 'height' => 140 ) ); ?> <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small><?php printf('%s at %s', get_the_date(), get_the_time()); ?></small> <p><?php the_content_limit(435); ?></p> <?php $posttags = get_the_tags(); $count=0; if ($posttags) { foreach($posttags as $tag) { $count++; if (1 == $count) { //echo $tag->name . ' '; // posts_by_tag(); } } }?> <!-- <h2 style="font-size: 17px;font-weight: 400; font-family: Georgia;color: #181818; font-style: italic;"> --> <!-- $tagposts ='english'; --> <!-- <?php posts_by_tag('',array('tag_from_post'=>TRUE)); ?> --> <!-- <?php echo do_shortcode( '[posts-by-tag number = "3" tag_from_post="true" ]' ); ?> --> <!-- </h2> --> </div> <!-- A list with another 3 articles from the same category--> <div class="rightn"> <ul> <?php } else { ?> <li> <?php get_the_image( array( 'size' => 'featured-cat-small', 'width' => 90, 'height' => 80 ) ); ?> <div class="rightcont"> <div class="bubble"><?php comments_popup_link('0', '1', '%', ' ', ' '); ?></div> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> <p><?php the_content_limit(110, ''); ?></p> <small><?php printf('%s at %s', get_the_date(), get_the_time()); ?></small> </div> <div style="clear:both;"></div> </li> <?php } ?> <?php endwhile; ?> </ul> <?php else : echo'<p>'; _e('There are no posts in this category.', 'wpzoom'); echo'</p>'; endif; ?> </div> <div class="clear"></div> </div><!-- end .category --> <?php } // while echo ' <!-- end .featCategory -->'; /* After widget (defined by themes). */ //echo $after_widget; wp_reset_query(); } /* Update the widget settings.*/ function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ $instance['title1'] = strip_tags( $new_instance['title1'] ); $instance['category1'] = $new_instance['category1']; $instance['color1'] = $new_instance['color1']; $instance['posts1'] = $new_instance['posts1']; $instance['exclude_featured'] = $new_instance['exclude_featured']; return $instance; } /** Displays the widget settings controls on the widget panel. * Make use of the get_field_id() and get_field_name() function when creating your form elements. This handles the confusing stuff. */ function form( $instance ) { /* Set up some default widget settings. */ $defaults = array( 'title1' => __('Category Name', 'wpzoom'), 'category1' => '0', 'color1' => 'blue', 'posts1' => '4', 'exclude_featured' => '' ); $instance = wp_parse_args( (array) $instance, $defaults ); global $wpzoomColors; ?> <p> <label for="<?php echo $this->get_field_id( 'title1' ); ?>"><?php _e('Category Title:', 'wpzoom'); ?></label> <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title1' ); ?>" name="<?php echo $this->get_field_name( 'title1' ); ?>" value="<?php echo $instance['title1']; ?>" /> </p> <p> <label for="<?php echo $this->get_field_id('color1'); ?>"><?php _e('Title Background Color:', 'wpzoom'); ?></label> <select id="<?php echo $this->get_field_id('color1'); ?>" name="<?php echo $this->get_field_name('color1'); ?>" style="width:90%;"> <?php foreach ($wpzoomColors as $key => $value) { $option = '<option value="'.$key; if ($key == $instance['color1']) { $option .='" selected="selected';} $option .= '">'; $option .= $value; $option .= '</option>'; echo $option; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('category1'); ?>"><?php _e('Category:', 'wpzoom'); ?></label> <select id="<?php echo $this->get_field_id('category1'); ?>" name="<?php echo $this->get_field_name('category1'); ?>" style="width:90%;"> <option value="0">Choose category:</option> <?php $cats = get_categories('hide_empty=0'); foreach ($cats as $cat) { $option = '<option value="'.$cat->term_id; if ($cat->term_id == $instance['category1']) { $option .='" selected="selected';} $option .= '">'; $option .= $cat->cat_name; $option .= ' ('.$cat->category_count.')'; $option .= '</option>'; echo $option; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('tags1'); ?>"><?php _e('Tags:', 'wpzoom'); ?></label> <select id="<?php echo $this->get_field_id('tags1'); ?>" name="<?php echo $this->get_field_name('tags1'); ?>" style="width:90%;"> <option value="0">Choose tags:</option> <?php $tags = get_tags('hide_empty=0'); foreach ($tags as $tag) { $option = '<option value="'.$tag->term_id; if ($tag->term_id == $instance['tags1']) { $option .='" selected="selected';} $option .= '">'; $option .= $tag->tag_name; $option .= ' ('.$tag->tag_count.')'; $option .= '</option>'; echo $option; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('posts1'); ?>"><?php _e('Posts to show:', 'wpzoom'); ?></label> <select id="<?php echo $this->get_field_id('posts1'); ?>" name="<?php echo $this->get_field_name('posts1'); ?>" style="width:90%;"> <?php $m = 0; while ($m < 11) { $m++; $option = '<option value="'.$m; if ($m == $instance['posts1']) { $option .='" selected="selected';} $option .= '">'; $option .= $m; $option .= '</option>'; echo $option; } ?> </select> </p> <p> <input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('exclude_featured'); ?>" name="<?php echo $this->get_field_name('exclude_featured'); ?>" <?php if ($instance['exclude_featured'] == 'on') { echo ' checked="checked"'; } ?> /> <label for="<?php echo $this->get_field_id('exclude_featured'); ?>"><?php _e('Exclude Featured Posts from Widget', 'wpzoom'); ?></label> <br/> </p> <?php } } function wpzoom_register_category_widget() { register_widget('wpzoom_widget_category'); } add_action('widgets_init', 'wpzoom_register_category_widget'); ?>
Forum: Plugins
In reply to: [HungryFEED] RSS Feed ofsetThank you for your quick reply .
It does sound a bit unusual on its own but we trying to achieve is using twice the same feed with different formating each time. The first time to be the featured post (together with image and excerpt ) and the second title just the title. So I need to hide on the second feed the first item as it appears above in the first feed.Actually I am using the free version until I manage the associates to upgrade.
Basically I copied the code for categories and replaced for tags.
But somethings is missing