Forum Replies Created

Viewing 15 replies - 31 through 45 (of 65 total)
  • Thread Starter dpope0824

    (@dpope0824)

    Could I do something such as use a custom field and have it be called in the title such as title="<?php the_field('video-caption'); ?>"

    • This reply was modified 8 years, 6 months ago by dpope0824.
    Thread Starter dpope0824

    (@dpope0824)

    Is there a way to change the way the posts are displayed such as calling the title last?

    Thread Starter dpope0824

    (@dpope0824)

    Is there any way to switch that to use the caption instead so I can load some html and set up an anchor tag to link to a related video? Prolly not but figured it cant hurt to ask.

    Thread Starter dpope0824

    (@dpope0824)

    Is there a function I could hook into to change the title displayed to a custom field instead?

    Thread Starter dpope0824

    (@dpope0824)

    So I decided to take a break on creating my own filter page. I am now using the Search and Filter pro plugin. Would you have any experience in getting this to work with easy fancybox after the ajax call? They have poor documentation on their website.

    Thread Starter dpope0824

    (@dpope0824)

    Bump

    Thread Starter dpope0824

    (@dpope0824)

    It’s on an internal server.

    On pastebin

    This is all the code including the page template, js, and the function being used. I can put onto a test site I have in just a bit.

    Thread Starter dpope0824

    (@dpope0824)

    Have tried multiple methods I have found online and ways other people got it working, but all those fixes seem to be quite old. Is there no other way to get the ajax loaded content to display in fancybox?

    Thread Starter dpope0824

    (@dpope0824)

    No other ideas?

    Thread Starter dpope0824

    (@dpope0824)

    I hope this wasnt too difficult of a question…..

    Could you not just use a custom query in your css to define orientation? Such as

    @media only screen
    and (min-device-width : 768px)
    and (max-device-width : 1024px)
    and (orientation : landscape) {
    #fancybox-content{
    width:123px;
    height:321px;
    }
    Thread Starter dpope0824

    (@dpope0824)

    Nope still defaulting to the original site link and ignoring class=”fancybox-youtube”

    Thread Starter dpope0824

    (@dpope0824)

    I would add that the posts themselves are not duplicated.

    Thread Starter dpope0824

    (@dpope0824)

    Nobody has any ideas. Am i just gonna have to do it like this $posts = query_posts(“cat=-1&order=DESC&posts_per_page=-1&year=2012&year=2013”);, seems kinda sloppy and does not appear to work correctly either.

    Thread Starter dpope0824

    (@dpope0824)

    No I do not, it does not recognize the “need” for pagination, it could be a problem in my code but it’s beyond my understanding. Have been out of the loop for awhile and still trying to catch up.

    <?php
    
    	if(isset($_POST['filter']))
    	{
    		$fbytype = $_POST['bytype'];
    		$fbytopic = $_POST['bytopic'];
    		$fbyregion = $_POST['byregion'];
    
    		$fsortby = $_POST['sortby'];
    		$fview = $_POST['view'];
    		$ispodcast = false;
    
    		require('../../../wp-blog-header.php'); 
    
    		if($fsortby=="recent"):
    			global $post;
    
                  $args= array
        (
            'offset'=>$offset,
            'cat' => 6,
            'paged'=>$paged,
            'orderby' => 'title',
            'order' => 'ASC'
        );
    		$posts = query_posts("$args");
    
    		if ( have_posts() )
    		{
    
    			if($fview=="grid")
    			{
    				grid_style();
    				while ( have_posts() )
    				{
    					$ispodcast = false;
    					the_post(); 
    
    					if(chechcategory($post->ID,$fbytype))
    					{
    						//echo chechcategory($post->ID,$fbytype).' : '.$post->ID .' : '.$fbytype.'<br>';
    						if(chechcategory($post->ID,$fbytopic))
    						{
    							//echo chechcategory($post->ID,$fbytopic).' : '.$post->ID .' : '.$fbytopic.'<br>';
    							if(chechcategory($post->ID,$fbyregion))
    							{
    								//echo chechcategory($post->ID,$fbyregion).' : '.$post->ID .' : '.$fbyregion.'<br>';
    								if(in_category(array(7),$post->ID))
    									$ispodcast = true;
    
    								$thumbsrc = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    								?>
    
    								<div class="result-container">
    									<div class="result-title">
    										<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    									</div>
    
    									<?php 
    
    									if($ispodcast)
    									{
    										?>
    										<div class="result-image">
    											<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/> </a><a class="podcast-overlay" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
    											<div class="podcast-overlay"></div>
    											</a>
    										</div>
    
    										<?php
    									}
    									else
    									{
    										?>
    										<div class="result-image">
    											<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/> </a>
    										</div>
    
    										<?php
    									}
    									?>
    
    									<div class="result-text"><?php the_excerpt_max_charlength(108,$post->ID);//the_excerpt(); ?></div>
    								</div>
    
    								<?php
    							}
    						}
    					}
    				}
    			}
    			else
    			{
    				list_style();
    				while ( have_posts() )
    				{
    					$ispodcast = false;
    					the_post(); 
    
    					if(chechcategory($post->ID,$fbytype))
    					{
    						//echo chechcategory($post->ID,$fbytype).' : '.$post->ID .' : '.$fbytype.'<br>';
    						if(chechcategory($post->ID,$fbytopic))
    						{
    							//echo chechcategory($post->ID,$fbytopic).' : '.$post->ID .' : '.$fbytopic.'<br>';
    							if(chechcategory($post->ID,$fbyregion))
    							{
    								//echo chechcategory($post->ID,$fbyregion).' : '.$post->ID .' : '.$fbyregion.'<br>';
    								if(in_category(array(7),$post->ID))
    									$ispodcast = true;
    
    								$thumbsrc = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    								?>
    
    								<div class="result-container">
    									<div class="result-left">
    			                        <?php
    									if($ispodcast)
    									{
    										?>
    										<div class="result-image">
    											<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a><a class="podcast-overlay" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
    											<div class="podcast-overlay"></div>
    											</a>
    										</div>
    
    										<?php
    									}
    									else
    									{
    										?>
    										<div class="result-image">
    											<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a>
    										</div>
    										<?php
    									}
    									?>
    									</div>
    
    									<div class="result-right">
    										<div class="result-title">
    											<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    										</div>
    
    										<div class="result-text">
    											<?php the_excerpt_max_charlength(108,$post->ID);//the_excerpt(); ?>
    										</div>
    									</div>	
    
    								</div>
    
    								<?php
    								}
    							}
    						}
    					}
    				}
    			}
    
    			endif;
    
    			if($fsortby=="shared" || $fsortby=="popular"):
    				$querystr = "
    				SELECT $wpdb->posts.*, CONVERT($wpdb->postmeta.meta_value,UNSIGNED INTEGER) AS Count
    				FROM $wpdb->posts, $wpdb->postmeta
    				WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id ";
    
    			if($fsortby=="shared")
    				$querystr.="AND $wpdb->postmeta.meta_key = 'total-share'";
    			else
    				$querystr.="AND $wpdb->postmeta.meta_key = 'total-count'";
    			$querystr.="
    			AND $wpdb->posts.post_status = 'publish'
    			AND $wpdb->posts.post_type = 'post'
    			AND $wpdb->posts.post_date < NOW()
    			ORDER BY Count DESC ";
    
    			$pageposts = $wpdb->get_results($querystr, OBJECT);
    			if ( $pageposts )
    			{
    				if($fview=="grid")
    				{
    					grid_style();
    					global $post;
    
    					foreach ($pageposts as $post)
    					{
    						$ispodcast = false;
    						setup_postdata($post);
    
    						if(!chechcategory($post->ID,1))
    							if(chechcategory($post->ID,$fbytype))
    							{
    								//echo chechcategory($post->ID,$fbytype).' : '.$post->ID .' : '.$fbytype.'<br>';
    								if(chechcategory($post->ID,$fbytopic))
    								{
    									//echo chechcategory($post->ID,$fbytopic).' : '.$post->ID .' : '.$fbytopic.'<br>';
    									if(chechcategory($post->ID,$fbyregion))
    									{
    										//echo chechcategory($post->ID,$fbyregion).' : '.$post->ID .' : '.$fbyregion.'<br>';
    										if(in_category(array(7),$post->ID))
    											$ispodcast = true;
    										$thumbsrc = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    										?>
    
    										<div class="result-container">
    											<div class="result-title">
    												<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    											</div>
    
    											<?php
    											if($ispodcast)
    											{
    												?>
    												<div class="result-image">
    													<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a><a class="podcast-overlay" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
    
    													<div class="podcast-overlay"></div>
    													</a>
    												</div>
    												<?php
    											}
    											else
    											{
    												?>
    												<div class="result-image">
    													<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a>
    												</div>
    												<?php
    											}
    											?>
    											<div class="result-text"><?php the_excerpt_max_charlength(108,$post->ID);//the_excerpt(); ?></div>
    										</div>
    
    										<?php
    									}
    								}
    							}
    						}
    					}
    					else
    					{
    						list_style();
    						global $post;
    
    						foreach ($pageposts as $post)
    						{
    							$ispodcast = false;
    							setup_postdata($post);
    
    							if(!chechcategory($post->ID,1))
    								if(chechcategory($post->ID,$fbytype))
    								{
    									//echo chechcategory($post->ID,$fbytype).' : '.$post->ID .' : '.$fbytype.'<br>';
    									if(chechcategory($post->ID,$fbytopic))
    									{
    										//echo chechcategory($post->ID,$fbytopic).' : '.$post->ID .' : '.$fbytopic.'<br>';
    										if(chechcategory($post->ID,$fbyregion))
    										{
    											//echo chechcategory($post->ID,$fbyregion).' : '.$post->ID .' : '.$fbyregion.'<br>';
    											if(in_category(array(7),$post->ID))
    												$ispodcast = true;
    
    											$thumbsrc = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    											?>
    
    											<div class="result-container">
    												<div class="result-left">
    			 									<?php
    												if($ispodcast)
    												{
    													?>
    													<div class="result-image">
    														<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a><a class="podcast-overlay" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><div class="podcast-overlay"></div></a>
    													</div>
    
    													<?php
    												}
    												else
    												{
    													?>
    													<div class="result-image">
    														<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php echo $thumbsrc; ?>" height="100px" width="210px" alt="Link to <?php the_title(); ?>"/></a>
    													</div>
    
    													<?php
    												}
    												?>
    												</div>
    
    												<div class="result-right">
    													<div class="result-title">
    														<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    													</div>
    
    													<div class="result-text">
    														<?php the_excerpt_max_charlength(108,$post->ID);//the_excerpt(); ?>
    													</div>
    												</div>
    											</div>
    
    											<?php
    											}
    										}
    									}
    								}
    							}
    						}
    						endif;
    
    					}
    
    					function grid_style()
    					{
    						echo '	<style>	#search-filter-page-continer .result-container		{						float:left;			margin-left: 18px;			padding-bottom: 40px;			width: 220px; height:215px;		}		#search-filter-page-continer .result-container .result-title		{			text-transform: uppercase;			font-weight: bold;			font-size:12px;	height:32px; line-height:16px;	}		#search-filter-page-continer .result-container .result-image		{ position:relative;			margin:10px 0px;			border: 1px solid #E1DEDE;			width:210px;			height:100px;					}		#search-filter-page-continer .result-container .result-text		{			overflow:hidden;			height:57px;			width:100%;		}</style>';
    
    					}
    
    					function list_style()
    					{
    
    						echo '<style> #search-filter-page-continer .result-container{	padding-bottom: 40px;			width: 100%;			height:140px;	padding-left:30px; position:relative; display:block;	}		#search-filter-page-continer .result-container .result-left		{			float:left;			width:220px;		}		#search-filter-page-continer .result-container .result-right		{			float:left;			margin-left: 30px;	 margin-top: 10px;		width: 520px;		}		#search-filter-page-continer .result-container .result-title		{			text-transform: uppercase;			font-weight: bold;			font-size:14px;					}		#search-filter-page-continer .result-container .result-image		{ position:relative;			border: 1px solid #E1DEDE;			width:210px;			height:100px;					}		#search-filter-page-continer .result-container .result-text		{			overflow:hidden;						width:100%;			height:58px;			margin-top: 15px;		}</style>';
    					}
    
    					function chechcategory($id,$category)
    					{
    						if($category=="")
    							return true;
    						return in_category(explode(',',$category),$id);
    					}
    
    					function the_excerpt_max_charlength($charlength,$id)
    					{
    
    						$synopses = get_post_meta($id,'synopsis',true);
    						if($synopses=="")
    							$synopses = get_the_excerpt();//get_post_meta($id, 'thumbnail-copy', true);
    
    						$excerpt=$synopses;
    						$excerpt = str_replace('[quote]','',$excerpt);
    						$charlength++;
    
    						if ( mb_strlen( $excerpt ) > $charlength )
    						{
    							$subex = mb_substr( $excerpt, 0, $charlength - 5 );
    							$exwords = explode( ' ', $subex );
    							$excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
    							if ( $excut < 0 )
    							{
    								echo mb_substr( $subex, 0, $excut );
    							}
    							else
    							{
    								echo $subex;
    							}
    							echo '...';
    						}
    						else
    						{
    							echo $excerpt;
    						}
    					}
    				?>

Viewing 15 replies - 31 through 45 (of 65 total)