Beispiel #1
0
global $charityHomeNews;

if ($charityHomeNews == "latestNewsSection"):
    ?><h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    <?php  do_action("charity_post_latest_format_attribute"); ?>
        <p><?php echo esc_html(charity_truncate_content(get_the_content(), 100)); ?>
            <a class="more-link btn btn-default" href="<?php the_permalink(); ?>"><?php esc_html_e("READ MORE", "charity"); ?></a>
        </p>
        <?php
        
elseif ($charityHomeNews == "twoSection"):
    ?>
    <div class="media col-xs-12 col-sm-12">
        <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
        <?php do_action("charity_post_latest_format_attribute"); ?>
        <p><?php echo esc_html(charity_truncate_content(get_the_content(), 100)); ?>
            <a class="more-link btn btn-default" href="<?php the_permalink(); ?>"><?php esc_html_e("READ MORE", "charity"); ?></a>
        </p>
    </div>
    <?php
else:    
?><article <?php post_class("blog"); ?>>
    <div class="row">
        <div class="col-xs-12 col-sm-10 col-sm-offset-1 caption">
            <h2 class="h1"><a href="<?php the_permalink(); ?> "><?php the_title() ?></a></h2>
            <?php do_action("charity_post_format_attribute"); ?>
            <?php the_content("READ MORE"); ?>
            
        </div>
    </div>
</article>
</figure>
                                        </a>                                
                                    <?php 
        }
        ?>

                                    <h3 class="h4"><?php 
        the_title();
        ?>
</h3>							
                                    <?php 
        do_action("charity_cauese_donation_details_sidebar");
        do_action("charity_cauese_donation_details_single");
        ?>
 <p><?php 
        echo esc_html(charity_truncate_content(get_the_content(), 200));
        ?>
</p><?php 
        //the_content("");
        do_action("charity_causes_donation_button");
        ?>
                                </div>

                            </div>
                            <?php 
    }
}
wp_reset_query();
?>

        if ($target != '' && $achivement != '' && $target > 0) {
            setlocale(LC_MONETARY, 'en_IN');
            $achivement = money_format('%!.0i', $achivement);
            $target = money_format('%!.0i', $target);
        }
        ?>
        <div class="donation-meter">
            <div class="container">
                <div class="row">
                    <div class="col-xs-12 ">
                        <h2 class="home-four-title"><?php 
        echo vp_option('vpt_option.ch_hfour_causes_title');
        ?>
</h2>
                       <p> <?php 
        echo charity_truncate_content(get_the_content(), 120);
        //the_content('');
        ?>
</p>

                        <div class="goal">
                            <span class="title"><?php 
        echo esc_html_e('Donated', 'charity');
        ?>
</span>
                            <span class="amount"><?php 
        printf("%s", $charityCurrency . $achivement);
        ?>
</span>
                        </div>
                        <div class="goal raised">
    public function widget($args, $instance)
    {
        $cache = array();
        if (!$this->is_preview()) {
            $cache = wp_cache_get('widget_recent_posts', 'widget');
        }
        if (!is_array($cache)) {
            $cache = array();
        }
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        $title = !empty($instance['title']) ? $instance['title'] : __('New Project', "charity");
        /** This filter is documented in wp-includes/default-widgets.php */
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        $number = !empty($instance['number']) ? absint($instance['number']) : 5;
        if (!$number) {
            $number = 5;
        }
        /**
         * Filter the arguments for the Recent Posts widget.
         *
         * @since 3.4.0
         *
         * @see WP_Query::get_posts()
         *
         * @param array $args An array of arguments used to retrieve the recent posts.
         */
        $latestQuery = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'post_type' => 'charity-project')));
        if ($latestQuery->have_posts()) {
            ?>

            <aside class="media new-project">
                <h3 class="space-top"><?php 
            printf("%s", $title);
            ?>
</h3>
                <ul>

                    <?php 
            while ($latestQuery->have_posts()) {
                $latestQuery->the_post();
                ?>

                        <?php 
                $format = get_post_format() ? get_post_format() : "standard";
                ?>

                        <li><a href="<?php 
                the_permalink();
                ?>
" class="pull-left">
                                <figure>
                                    <?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('charity-new-project');
                }
                ?>
                                </figure>
                            </a>
                            <div class="media-body">
                                <h4>
                                    <a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo esc_html(charity_truncate_content(get_the_title(), 29));
                ?>
</a></h4>
                                <p><?php 
                echo esc_html(charity_truncate_content(get_the_content(), 60));
                ?>
</p>

                            </div></li>

                    <?php 
            }
            ?>

                </ul>

            </aside>




            <?php 
            // Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();
        }
        if (!$this->is_preview()) {
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('widget_recent_posts', $cache, 'widget');
        } else {
            ob_end_flush();
        }
    }
Beispiel #5
0
    
        $target = vp_metabox('doantion-settings.donation-target') ? vp_metabox('doantion-settings.donation-target') : '0';
        $achivement = vp_metabox('doantion-settings.donation-achivement') ? vp_metabox('doantion-settings.donation-achivement') : '0';

        echo '<script type="text/javascript"> var charity_speedo_percent = ' . esc_attr(intval($achivement / $target * 100)) . '; </script><script></script>';

        setlocale(LC_MONETARY, 'en_IN');
        $achivement = money_format('%!.0i', $achivement);
        $target = money_format('%!.0i', $target);
        ?>
        <div class="donation-meter">
            <div class="container">
                <div class="row">
                    <div class="col-xs-12 ">
                        <h2 class="home-four-title"><?php echo vp_option('vpt_option.ch_hfour_causes_title'); ?></h2>
                       <p> <?php  echo charity_truncate_content(get_the_content(), 120); //the_content(''); ?></p>

                        <div class="goal">
                            <span class="title"><?php echo esc_html_e('Donated', 'charity'); ?></span>
                            <span class="amount"><?php printf("%s", $charityCurrency . $achivement); ?></span>
                        </div>
                        <div class="goal raised">
                            <span class="title"><?php echo esc_html_e('Target', 'charity'); ?></span>
                            <span class="amount"><?php printf("%s", $charityCurrency . $target); ?></span>
                        </div>
                        <?php do_action("charity_speedometer_donors"); ?>         
                    </div>
                </div>
            </div><!-- .container ends here -->
            <div id="donator"  class="owl-carousel owl-theme">
                <?php do_action("charity_speedometer_donation_user"); ?>           
Beispiel #6
0
    public function widget($args, $instance) {
        $cache = array();
        if (!$this->is_preview()) {
            $cache = wp_cache_get('widget_recent_posts', 'widget');
        }

        if (!is_array($cache)) {
            $cache = array();
        }

        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }

        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }

        ob_start();

        $title = (!empty($instance['title']) ) ? $instance['title'] : __('Recent', "charity");

        /** This filter is documented in wp-includes/default-widgets.php */
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);

        $number = (!empty($instance['number']) ) ? absint($instance['number']) : 5;
        if (!$number)
            $number = 5;

        /**
         * Filter the arguments for the Recent Posts widget.
         *
         * @since 3.4.0
         *
         * @see WP_Query::get_posts()
         *
         * @param array $args An array of arguments used to retrieve the recent posts.
         */
        $latestQuery = new WP_Query(apply_filters('widget_posts_args', array(
                    'posts_per_page' => $number,
                    'no_found_rows' => true,
                    'post_status' => 'publish',
                    'ignore_sticky_posts' => true
        )));

        if ($latestQuery->have_posts()) :
            ?>

			<aside class="media">
		<h3 class="space-top"><?php printf("%s", $title);  ?></h3>
		<ul>
			
			<?php while ($latestQuery->have_posts()) : $latestQuery->the_post(); ?>
			
			<?php $format=(get_post_format()) ? get_post_format() : "standard"; ?>
			
			<li><a href="<?php the_permalink(); ?>" class="pull-left">
					<figure>
						<?php 
						if($format=="image"){
							if (has_post_thumbnail()) {
                         the_post_thumbnail('charity-recentpost-thumb');
                                    }
						}
						if($format=="gallery"){
							$metaValueGallery = vp_metabox('gallery_meta.gallery_group');
							$gallery_img=$metaValueGallery[0]['gallery_image']; ?>
							<img src="<?php echo esc_url(charity_resize($gallery_img,98,98));?>" alt="" />		
						<?php }
						if($format=="video"){
							$metaValueVideoImage = vp_metabox('video_meta.video_image'); ?>
							<img src="<?php echo esc_url(charity_resize($metaValueVideoImage,98,98));?>" alt="" />	
					 <?php	}
						
						?>
						
					</figure>
			</a>
				<div class="media-body">
					<p>
						<a href="<?php the_permalink(); ?>"><?php echo esc_html(charity_truncate_content(get_the_title(), 29)); ?></a>
					</p>
					<span><?php printf("%s", get_the_date("d, F'y")); ?></span>
				</div></li>
				
				<?php endwhile; ?>
			
		</ul>

	</aside>




            <?php
// Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();

        endif;

        if (!$this->is_preview()) {
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('widget_recent_posts', $cache, 'widget');
        } else {
            ob_end_flush();
        }
    }