public function widget($args, $instance)
    {
        $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'];
        }
        // This is where you run the code and display the output
        ?>

	<div class="wt-featured-page-widget-container">

	<?php 
        $featured_page = get_post($instance['featured-page'], OBJECT);
        $custom_desc = $instance['custom-description'];
        echo $custom_desc ? '<p>' . $custom_desc . '</p>' : get_excerpt_by_id($featured_page->ID, $instance['excerpt-length']);
        echo '<div class="featured-page-widget-link-container"><a href="' . get_permalink($featured_page->ID) . '">' . $instance['link-text'] . '<i class="fa fa-long-arrow-right"></i></a></div>';
        ?>
	
	</div>

	<?php 
        echo $args['after_widget'];
    }
Exemple #2
0
 /**
  * Set meta description based on template.
  */
 function seo_description()
 {
     if (get_post_type(array('post', 'page', 'product'))) {
         $description = get_post_meta(get_the_ID(), '_fathom_seo_description', true);
         if ($description == '') {
             $description = get_excerpt_by_id(get_the_ID());
         }
     } elseif (is_product_category()) {
         global $wp_query;
         $cat_id = $wp_query->get_queried_object_id();
         $description = single_term_title() . ' - ' . strip_tags(term_description($cat_id, 'product_cat'));
     }
     // fallback
     if (!isset($description) || $description == '') {
         $description = get_bloginfo('description');
     }
     return esc_attr($description);
 }
"><span class="surge-timeline-snapshot-number"><?php 
        echo '#' . $found_posts;
        ?>
</span></a>
                    <span class="surge-timeline-snapshot-date"><?php 
        echo get_the_date();
        ?>
</span>
                    <a href="<?php 
        echo get_permalink();
        ?>
"><h5><?php 
        the_title();
        ?>
</h5></a>
                    <?php 
        echo get_excerpt_by_id($post->ID, 20);
        ?>
                </div>
            </div>


        <?php 
        $found_posts--;
    }
}
/* Restore original Post Data */
wp_reset_postdata();
?>

</div>
Exemple #4
0
function email_subscribers($post_ID)
{
    $post = get_post($post_ID);
    if ($post->post_date == $post->post_modified) {
        //run only on new post creation
        $sql = 'call sp_getSubscriberEmails()';
        $dbo = PmaPdoDb::getInstance();
        $dbo->connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
        $dbo->query($sql);
        $rows = $dbo->resultset();
        $emails = array();
        foreach ($rows as $row) {
            $emails[] = $row['user_email'];
        }
        // $author = get_user_by('id', $post->post_author );
        //echo ucwords($post->post_title) . '<br/>';
        // echo 'by: ' . $author->display_name  . '<br/>';
        $category = get_the_category($post);
        $emailCats = "";
        foreach ($category as $cat) {
            $emailCats .= '[ ' . $cat->cat_name . ' ]';
        }
        $vineImg = '<img src="http://www.pma.com/~/media/pma-images/grapevineEmailImage.png" style="float:left;" alt="PMA Grapevine" />';
        //$vineImg = '<img src="http://jxr980:8020/vinedev/wp-content/uploads/2015/07/transgrape2_small.png" style="float:left; alt="PMA Grapevine"  />';
        $emailTitle = 'New Vine Post: ' . ucwords($post->post_title);
        $postLink = '<p><a href="' . get_permalink($post_ID) . '">Read more of this post</a></>';
        $msg = '<table><tr><td>' . $vineImg . '</td><td style="font-family:calibri; width:120px;valign:middle;text-align:left;"><H3>' . ucwords($post->post_title) . '</H3><h5>' . $emailCats . '</h5></td></tr>';
        $msg .= '<tr><td style="font-family:calibri;" colspan="2">' . get_excerpt_by_id($post) . $postLink . '</td></tr></table>';
        //echo $post->post_type;
        //echo $msg;
        //echo $post->post_date . '<br/>' . $post->post_modified . '<br/>';
        //die();
        sendMail($emailTitle, $msg, $emails, false, 'PMA Grapevine');
        return $post_ID;
    }
}
Exemple #5
0
function surf_subpages_func($atts)
{
    $post_alquiler = 7;
    $post_cursos = 11;
    $post_camps = 13;
    if (function_exists(pll_get_post)) {
        $post_alquiler = pll_get_post($post_alquiler);
        // will get ID of post in current lang
        $post_cursos = pll_get_post($post_cursos);
        $post_camps = pll_get_post($post_camps);
    }
    $link_alquiler = get_post($post_alquiler);
    $link_alquiler_thumb = get_the_post_thumbnail($post_alquiler, 'pricing__img');
    $link_alquiler_link = get_permalink($post_alquiler);
    $link_alquiler_extracto = wpautop(get_excerpt_by_id($post_alquiler), true);
    $link_cursos = get_post($post_cursos);
    $link_cursos_thumb = get_the_post_thumbnail($post_cursos, 'pricing__img');
    $link_cursos_link = get_permalink($post_cursos);
    $link_cursos_extracto = wpautop(get_excerpt_by_id($post_cursos), true);
    $link_camps = get_post($post_camps);
    $link_camps_thumb = get_the_post_thumbnail($post_camps, 'pricing__img');
    $link_camps_link = get_permalink($post_camps);
    $link_camps_extracto = wpautop(get_excerpt_by_id($post_camps), true);
    $output = '
<ul class="pricingtables ancho">
  <li class="pricingtable link_alquiler">
    <header class="pricing__header">
' . $link_alquiler_thumb . '
      <h3><a href="' . $link_alquiler_link . '">' . $link_alquiler->post_title . '</a></h3>
    </header>
    <section class="pricing__body">
      ' . $link_alquiler_extracto . '
    </section>
    <ul class="pricing__footer">
      <li class="striped--primary"><a href="' . $link_alquiler_link . '">' . __('Details', 'hanna-child') . '</a></li>
    </ul>
  <!-- /li intentionally omitted -->
  <li class="pricingtable">
    <header class="pricing__header pricing__header--secondary">
' . $link_cursos_thumb . '
      <h3><a href="' . $link_cursos_link . '">' . $link_cursos->post_title . '</a></h3>
    </header>
    <section class="pricing__body pricing__body--secondary">
      ' . $link_cursos_extracto . '
    </section>
    <ul class="pricing__footer pricing__footer--secondary">
      <li class="striped--secondary"><a href="' . $link_cursos_link . '">' . __('Details', 'hanna-child') . '</a></li>
    </ul>
  <!-- /li intentionally omitted -->
  <li class="pricingtable">
    <header class="pricing__header">
' . $link_camps_thumb . '
      <h3><a href="' . $link_camps_link . '">' . $link_camps->post_title . '</a></h3>
    </header>
    <section class="pricing__body">
      ' . $link_camps_extracto . '
    </section>
    <ul class="pricing__footer">
      <li class="striped--primary"><a href="' . $link_camps_link . '">' . __('Details', 'hanna-child') . '</a></li>
    </ul>
  <!-- /li intentionally omitted -->
</ul>
	';
    return $output;
}
<div class="promote-post-container">
    <div class="row">
        <div class="columns medium-5">
            <?php 
echo get_the_post_thumbnail($post_id, 'thumbnail-card');
?>
            <a href="<?php 
echo get_permalink($post_id);
?>
" class="button" style="margin-top: 15px;margin-bottom: 0px;width:100%;">Learn More</a>
        </div>
        <div class="columns medium-7">
            <a href="<?php 
echo get_permalink($post_id);
?>
"><h4><?php 
echo $title;
?>
</h4></a>
            <p><?php 
echo $description ? $description : get_excerpt_by_id($post_id);
?>
</p>
        </div>
    </div>
</div>
Exemple #7
0
     single_tag_title();
     echo '&quot; - ';
     bloginfo('name');
 } else {
     if (is_archive()) {
         wp_title('');
         echo ' - ';
         bloginfo('name');
     } else {
         if (is_search()) {
             echo 'Buscado por &quot;&quot; - ';
             bloginfo('name');
         } else {
             if (is_home()) {
                 bloginfo('name');
                 echo ' - ';
                 bloginfo('description');
             } else {
                 if (is_404()) {
                     bloginfo('name');
                     echo '- Error 404 Nada Encontrado';
Exemple #8
0
<?php

add_action('wp_head', 'smamo_add_metas');
function smamo_add_metas()
{
}
// Billede
$meta_img = wp_get_attachment_url(get_post_thumbnail_id(get_the_ID()));
if (!$meta_img) {
    $meta_img = get_header_image();
}
// Beskrivelse
if (!$wp_query) {
    $meta_description = wp_trim_words(get_bloginfo('description'), $num_words = 15, $more = ' ...');
} else {
    $meta_description = get_excerpt_by_id(get_the_ID());
    if (!$meta_description) {
        $meta_description = wp_trim_words(get_bloginfo('description'), $num_words = 15, $more = ' ...');
    }
}
// Link
$meta_url = get_the_permalink();
if (!$meta_url) {
    $meta_url = get_bloginfo('url');
}
// Type
$meta_type = 'article';
if (is_archive()) {
    $meta_type = 'archive';
} else {
    if (is_home()) {
        $post_thumb = $img_path;
    } else {
        $post_thumb = null;
    }
}
$permalink = get_the_permalink($post_ID);
if ($post_thumb !== null) {
    $img_content = '<a href="' . $permalink . '">
						<span class="post-thumb-medium lazy margRtLg" style="background-image: url(' . $post_thumb . ');"  data-original="' . $post_thumb . ' </span>
					</a>';
} else {
    $img_content = '';
}
$post_title = get_the_title($post_ID);
//$the_excerpt = get_the_excerpt();
$the_excerpt = get_excerpt_by_id($post_ID, 224);
//$tag_footer = sensitive_skin_bootstrap_archive_entry_footer();
$subtitle = get_post_meta($post->ID, 'subtitle', true);
if (!$subtitle) {
    $the_author = get_the_author();
} else {
    if ($subtitle) {
        $the_author = $subtitle;
    }
}
$rp .= '
			    <div class="floatLt post-thumb-image-container">' . $img_content . '

					
				
				
									        	<a href="<?php 
                        echo esc_url(get_category_link($cat->term_id));
                        ?>
"><?php 
                        echo esc_html($cat->name);
                        ?>
</a>
									    <?php 
                    }
                }
                ?>
									</div>
							    </div>
							    
							    <?php 
                echo pp_substr(get_excerpt_by_id($post->ID), 110);
                ?>
						    <?php 
                break;
        }
        ?>
					    </div>
					    
					</div>
				
				</div>
				<!-- End each blog post -->
				
				<?php 
        $key++;
        ?>
function the_special_excerpt($postId, $max, $continue)
{
    $text = get_excerpt_by_id($postId);
    echo wp_html_excerpt($text, $max, $continue);
}
 //Section Title Check
 if (isset($page_id)) {
     if (rwmb_meta("100foldstudio_wn_section_{$wn_counter}_title")) {
         echo '<h4>' . rwmb_meta("100foldstudio_wn_section_{$wn_counter}_title") . '</h4>';
     } else {
         echo '<h4>' . get_the_title($page_id) . '</h4>';
     }
 } else {
     echo '<h4>' . rwmb_meta("100foldstudio_wn_section_{$wn_counter}_title") . '</h4>';
 }
 //Section Description Check
 if (isset($page_id)) {
     if (rwmb_meta("100foldstudio_wn_section_{$wn_counter}_description")) {
         echo rwmb_meta("100foldstudio_wn_section_{$wn_counter}_description");
     } else {
         echo get_excerpt_by_id($page_id);
     }
 } else {
     echo rwmb_meta("100foldstudio_wn_section_{$wn_counter}_description");
 }
 //Section Link Check
 if (isset($page_id)) {
     if (rwmb_meta("100foldstudio_wn_section_{$wn_counter}_link_text")) {
         $link_text = rwmb_meta("100foldstudio_wn_section_{$wn_counter}_link_text");
         $link_url = get_permalink($page_id);
         echo '<a href= "' . $link_url . '" class="button button-alt inverted">' . $link_text . '</a>';
     } else {
         $link_url = get_permalink($page_id);
         echo '<a href= "' . $link_url . '" class="button button-alt inverted">Learn More</a>';
     }
 } else {
                            <?php 
            the_post_thumbnail('medium');
            ?>
                        </a>
				   	</div>
				   	<div class="medium-8 columns program-archive-program-content">
				   		<h5><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h5>
                        <?php 
            // Display Program Excerpt
            echo get_excerpt_by_id($post->ID, 38, false);
            if ($program_info->rolling_enrollment_status == 1) {
                echo '<span class="school-instance"><i class="fa fa-refresh"></i> Rolling Enrollment</span>';
            } else {
                if (count($program_info->schedule) > 0) {
                    foreach ($program_info->schedule as $school) {
                        echo '<a href="' . get_the_permalink() . '#upcoming-schools"><span class="school-instance"><i class="fa fa-thumb-tack"></i> ' . $school['quarter'] . '</span></a>';
                    }
                }
            }
            ?>
                        
                        
                        
                        
				   	</div>
function humbleshop_fb_opengraph() {
	$post_id = '';
	$wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large'); ?>
	<!-- Open Graph -->
	<meta property="og:title" content="<?php the_title(); ?>" />
	<meta property="og:url" content="<?php the_permalink(); ?>" />
	<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
	<meta property="og:description" content="<?php echo $my_excerpt = get_excerpt_by_id($post_id); ?>" />
	<meta property="og:image" content="<?php echo $wpc_image_url[0] ?>"/>
<?php }
    ?>
"/>
	<meta property="og:type" content="website"/>
	<meta property="og:image" content="<?php 
    echo get_template_directory_uri();
    ?>
/resources/images/whohaha-fb.jpg" />
<?php 
} else {
    ?>
	<meta property="og:title" content="<?php 
    the_title();
    ?>
"/>
	<meta property="og:description" content="<?php 
    echo get_excerpt_by_id($post_id);
    ?>
"/>
	<meta property="og:url" content="<?php 
    the_permalink();
    ?>
"/>
	<meta property="og:type" content="<?php 
    if (is_single() || is_page()) {
        echo "article";
    } else {
        echo "website";
    }
    ?>
"/>
	<?php 
Exemple #16
0
			<script src="<?php 
echo THEME_URL . '/assets/js/vendor/zepto.js';
?>
"></script>
			<?php 
//wp_head();
?>

			<?php 
if (has_post_thumbnail($post->ID)) {
    $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'large');
}
?>

			<?php 
$description = get_excerpt_by_id($post->ID);
?>

			<!-- Facebook -->
			<meta property="fb:admins" content="1510546796" />
			<meta property="fb:admins" content="1065501018" />
			<meta property="fb:app_id" content="163727017160624"/>
			<meta property="og:title" content="<?php 
single_post_title();
?>
">
			<meta property="og:type" content="article">
			<meta property="og:url" content="<?php 
echo get_permalink();
?>
">
$tnCount = 0;
?>
<div id="FiveColumnContainerTop" class="margBotSm">
Previously, on Sensitive Skin!
</div>
<div class="grid" id="colcontainer">
<!-- <div id="colcontainer">
 -->		<?php 
$current_issue_query = new WP_Query('showposts=5&tag=featured&orderby=rand');
?>
		<?php 
while ($current_issue_query->have_posts()) {
    $current_issue_query->the_post();
    $postimageurl = get_post_meta($post->ID, 'post-img', true);
    $tnCount++;
    $the_excerpt = get_excerpt_by_id($post->ID, 180);
    //in functions.php
    $permalink = get_the_permalink($post->ID);
    ?>
			
<!-- 			<div id="column<?php 
    echo $tnCount;
    ?>
" >
 -->			
 					<div class="grid-item">
						<?php 
    if ($postimageurl) {
        ?>
							<a class="the-display" href="<?php 
        the_permalink();
         echo '<a href="' . get_permalink($postid) . '" title="Click to view ' . $event_title . '">';
         echo '<div class="col-sm-12 no-padding">';
         echo '<div class="col-sm-2 no-padding img">';
         if (has_post_thumbnail($postid)) {
             //if featured image is uploaded...
             $image = get_post_thumbnail_id($postid);
             $img = wp_get_attachment_url($image);
             echo '<img class="thumbnail" src="' . $img . '">';
         } else {
             echo '<div class="thumbnail default"></div>';
         }
         echo '</div>';
         echo '<div class="col-sm-8 descrip">';
         echo '<h3>' . $event_title . '</h3>';
         echo '<div class="ai1ec-time"><strong>When:</strong> ' . $event_date . '</div>';
         echo '<p>' . get_excerpt_by_id($postid) . '</p>';
         echo '</p>';
         echo '</div>';
         echo '<a <a href="' . get_permalink($postid) . '">';
         echo '<div class="col-sm-2 no-padding pull-right">';
         echo '<div class="more">';
         echo '<p class="view">View Event</p>';
         echo '</div>';
         echo '</div>';
         echo '</a>';
         echo '<div class="clear"></div>';
         echo '<hr>';
     }
 }
 echo '<a href="' . get_bloginfo('url') . '/calendar" class="button primary">View More Events</a>';
 echo '</div>';
 function make_body_div($p, $url)
 {
     $title = $p['post_title'];
     $excerpt = get_excerpt_by_id($p['ID']);
     $h4 = "<h4 class='media-heading'><a href='{$url}'>{$title}</a></h4>";
     $text = "<p>{$excerpt}</p>";
     $icon = '<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>';
     $button = "<a href='{$url}' class='btn btn-default btn-sm'>Read More {$icon}</a>";
     return "<div class='media-body'>{$h4}{$text}{$button}</div>";
 }
Exemple #20
0
											<div class="medium-5 columns">
						<?php 
        echo get_the_post_thumbnail($featured_program->ID, 'thumbnail-card');
        ?>
												<a href="<?php 
        echo get_permalink($featured_program->ID);
        ?>
" class="button">Learn More</a>
											</div>
											<div class="medium-7 columns post-featured-program-desc">
												<h5>Want to know more about <?php 
        echo $featured_program->post_title;
        ?>
?</h5>
						<?php 
        echo get_excerpt_by_id($featured_program->ID, 60);
        ?>
											</div>
										</div>
									</div>
					<?php 
    }
    ?>
				
			</div>
			
			<footer>
				<?php 
    get_template_part('parts/post-meta');
    ?>
			</footer>
	        </div>
		</div>
		
		<!-- Kids clubs -->
		<?php 
    $kids = get_post(198);
    // Get kids clubs page title by page id
    ?>
		<div class="slide" id="slide7" data-slide="7" data-stellar-background-ratio="0.5">
			<div class="slide-text">
	        	<h2><?php 
    echo $kids->post_title;
    ?>
</h2>
	            <p><?php 
    echo get_excerpt_by_id(198);
    ?>
</p>
	            <!-- <h3><a href="<?php 
    echo get_permalink(198);
    ?>
" title="Read More">Read More</a></h3> -->
	            <div class="clear"></div>
	             <!-- <a class="wgt-tr-but normal_button_book" href="<?php 
    echo esc_url(home_url('/'));
    ?>
book-now/" target="_blank">Book Now</a> -->
	           
	           <a class="wgt-tr-but" href="<?php 
    echo esc_url(home_url('/'));
    ?>
            echo '<div class="thumb-author">' . $subtitle . '</div>';
        }
    }
    ?>
			</div>
			<?php 
}
?>
		</header><!-- .entry-header -->

		<div class="archive-entry-content clearfix">
			
	            <div class="thumb-excerpt paddingRtSm">
                        <div class="entry paddingRtSm">
						<?php 
$the_excerpt = get_excerpt_by_id($post_ID);
echo $the_excerpt;
?>
						<a href="<?php 
the_permalink();
?>
"><div class="read-more margTopLg">Read More</div></a>
                        </div>
                        
					</div>

			<?php 
wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'sensitive-skin-bootstrap'), 'after' => '</div>'));
?>
		</div><!-- .entry-content -->
             * the main blog
             */
        } elseif (is_tax('program_taxo')) {
            // Get Queried Object
            $queried_object = get_queried_object();
            $program_object = get_page_by_path($queried_object->slug, OBJECT, 'program');
            ?>
	
		<div class="archive-header-title">
			<h1><?php 
            echo single_term_title();
            ?>
</h1>
		</div>
    <?php 
            echo get_excerpt_by_id($program_object->ID, 60, true, 'View School Page');
            ?>
		<div class="archive-header-meta clearfix">
			<div>
				<?php 
            global $page;
            ?>
				<?php 
            echo get_query_var('paged') ? 'Page ' . get_query_var('paged') : 'Page ' . 1;
            ?>
				<?php 
            echo ' of ' . $wp_query->max_num_pages;
            ?>
			</div>
			<div>
				<?php