Forum Replies Created

Viewing 15 replies - 16 through 30 (of 48 total)
  • Thread Starter wedideas

    (@wedideas)

    Thanks again Dima, working fine now ??

    Thread Starter wedideas

    (@wedideas)

    Thanks Dima, working fine now ??

    James

    Thread Starter wedideas

    (@wedideas)

    Thank you for such a quick response ??

    Thread Starter wedideas

    (@wedideas)

    Perfect, thank you ??

    Going forwards, do you think it might be possible to also display different types of information depending on what type of listing it is?

    i.e. Premium gets to show all options and/or have social media links, and standard maybe doesn’t have a gallery, or social media? Just an idea.

    Thanks for you time,

    James

    Thread Starter wedideas

    (@wedideas)

    Hi Brook,

    any update on this as it’s been over 2 weeks now and need to get this sorted.

    Appreciate your time,

    James

    Thread Starter wedideas

    (@wedideas)

    Hi Brook, we’re with TSO Host and we’re using the Powerhouse VPS which has 8x zeon core with 8gb RAM so I don’t think it’s going to be a hardware issue.

    This problem is only affecting the homepage with or without the sidebar widget.

    Where is the code that hooks into the main loop? Is it possible to override that function in our functions.php to not run on the homepage?

    Thanks again.

    James

    Thread Starter wedideas

    (@wedideas)

    Hi Brook, any update on how I can stop this from happening?

    Thanks,

    James

    Thread Starter wedideas

    (@wedideas)

    Hi Brook,

    FYI I have saved both checked and unchecked ‘include in main loop’ options and the problem is still persisting, although it seems totally random. Sometimes it causes a problem, sometimes it doesn’t.

    James

    Thread Starter wedideas

    (@wedideas)

    Hi Brook,

    We are running an events widget in the sidebar, but the problem still exists when I make the widget inactive, clear cache and refresh so it isn’t related to this.

    The plugin option to include events in the main loop is unchecked. I’m going to check it, save and uncheck it to see if this solves it but don’t hold much hope.

    Is there a function/filter I could use to ask the calendar to not run on the homepage loop? (obviously we would still want to the widget to function)

    Thanks,

    James

    Thread Starter wedideas

    (@wedideas)

    Is there a way to exclude the tribe_events loop from running on our homepage?

    Thread Starter wedideas

    (@wedideas)

    Hi Mark,

    thanks for your reply, hopefully it’ll be soon enough ??

    James

    Hi @catchmohl, You’ll need to put that code inside your website header, wrapped inside a <script> tag. If you’re not code savvy it may be better to get someone who is to help, as you will need to edit one of your theme files. What theme are you using?

    Regards

    Hi all,

    I had the same problem – i got around it by creating a small jquery script that applied the class ‘alignright’ to the wrapper that the pinterest plugin applies to any image with the class of alignright. Here’s my code for anyone who is interested…

    // make sure the pinterest button doesn't cause our aligned right images to break the layout
    	jQuery('#main').find('.pibfi_pinterest img').each(function() {
    		if (jQuery(this).hasClass("alignright")) {
    			jQuery('.pibfi_pinterest').addClass("alignright");
    		}
    	});
    Thread Starter wedideas

    (@wedideas)

    Hi Sandeep, here is the working code I’m using…

    <?php
    /*
    Plugin Name: Hot Topics
    Plugin URI: https://www.weddingideasmag.com
    Description: Use this widget to choose an array of posts snippets to show
    Version: 1.0)
    Author: James Payne
    Author URI: https://www.bluntcreative.co.uk
    License: GPL2
    */
    
    // register widget
    add_action( 'widgets_init', function() {
        register_widget( 'HotTopics' );
    });
    
    class HotTopics extends WP_Widget {
    
    ///////////////////////////
    // Initialise the widget //
    ///////////////////////////	
    
        function HotTopics() {
            $this->WP_Widget(
                'hottopics',
                __('Hot Topics'),
                array(
                    'name' => 'Hot Topics',
                    'classname' => 'widget-hot-topics',
                    'description' => __( "Use this widget to choose an array of posts snippets to show in the sidebar." )
                )
            );
        }
    
    	// The admin form for the widget
    
    ///////////////////////////
    // Setup the form fields //
    ///////////////////////////
    
        function form( $instance )
        {
            if( $instance ) {
    			$title = $instance['title'];
                $select = $instance['select'];
    		} else {
    			$title ='';
                $select ='';
    		} ?>
    
    		<p>
    			<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title:', 'wp_widget_plugin'); ?></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 $title; ?>" />
    		</p>
    
    	<?php
    
    		// Populate the select list with the post titles
            $get_posts = get_posts( array(
                'offset'=> 1,
                'orderby' => 'title',
                'order' => 'ASC',
                'posts_per_page' => -1,
                'post_status' => 'publish'
            ));
    
    		// If there are posts, populate the select
            if( $get_posts ) {
    
    			echo '<p>There are <strong>' . count($get_posts) . '</strong> posts in the database. Choose the hot topics from the choices below&hellip;</p>';?>
    
    			<label for="<?php echo $this->get_field_id('select'); ?>"><?php _e('Posts:', 'wp_widget_plugin'); ?></label>
    
    			<?php
                printf (
                    '<select multiple="multiple" name="%s[]" id="%s" class="widefat" size="15" style="margin-bottom:10px">',
                    $this->get_field_name('select'),
                    $this->get_field_id('select')
                );
    
    			// Each individual option
                foreach( $get_posts as $post )
                {
                    printf(
                        '<option value="%s" class="hot-topic" %s style="margin-bottom:3px;">%s</option>',
                        $post->ID,
                        in_array( $post->ID, $select) ? 'selected="selected"' : '',
                        $post->post_title
                    );
                }
    
                echo '</select>';
    
            } else {
    
    			// No posts were found
                echo 'No posts found :(';
    
    		} // END: if( $get_posts ) {
    
        } // END: function form( $instance ) 
    
    //////////////////////////////////////////////////////////////////
    // The update function to insert the chosen values in to the db //
    //////////////////////////////////////////////////////////////////
    
        function update( $new_instance, $old_instance )
        {
            $instance = $old_instance;
            $instance['select'] = esc_sql( $new_instance['select'] );
    		$instance['title'] = esc_sql( $new_instance['title']);
            return $instance;
        }
    
    /////////////////////////////////////////
    // The front end display of the widget //
    /////////////////////////////////////////
    
    	function widget($args, $instance) {
    	   extract( $args );
    	   // these are the widget options
    	   $title = apply_filters('widget_title', $instance['title']);
    	   $text = $instance['select'];
    	   echo $before_widget;
    		   // Display the widget
    		   echo '<div class="widget-text wp_widget_plugin_box">';
    
    		   // Check if title is set
    		   if ( $title ) {
    			  echo $before_title . $title . $after_title;
    		   }
    
    		   // Check if text is set
    			if( $text ) { ?>
    
    				<div class="sidebar-posts">
    
    					<?php query_posts(array('post_type' => 'post', 'post__in' => $text, 'orderby' => 'rand')); ?>
    
    					<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    						<div class="sidebar-posts-entry">
    
    							<?php if ( has_post_thumbnail() ) {?>
    
    								<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( array(75,75),array('class' => 'thumbnail'));?></a>
    
    							<?php } ?>
    
    							<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
    
    							<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,12).'&hellip; '; ?></p>
    
    						</div>
    
    						<div style="clear:both;" class="clearBoth"></div>
    
    					<?php endwhile; endif; ?>
    
    				</div> <?php // END: <div class="sidebar-posts">
    
    				// Reset Query
    				wp_reset_query();
    
    			 // print_r($text);
    		   }
    		   echo '</div>';
    	   echo $after_widget;
    	}
    
    } // END: class HotTopics
    
    ?>
    Thread Starter wedideas

    (@wedideas)

    Hi Alex,

    I thought I’d try a test and add the username’s to the native WordPress comment blacklist and lo and behold, it appears to be working as I need it ??

    Also, why suggest that I should write an additional plugin? Not everyone has the knowledge or inclination to do that just because they have a query about a plugin someone else has written.

Viewing 15 replies - 16 through 30 (of 48 total)