WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to use fancybox(vimeo linked thumbnail) directly from index page in tanzaku? (3 posts)

  1. raoyop
    Member
    Posted 3 years ago #

    Hi~

    I'm trying to use fancybox(vimeo-link) directly from index page of the tanzaku theme for wordpress.

    In case of image, don't have any problem.
    But thumbnail image about vimeo link does not work....

    I want to show a thumbnail images on the index page,
    and then click on a thumbnail image is to be shown to fancybox.

    ($flg_img_forcelink=false <- variable about image link.)

    I think that probably need to modify the source files(index.php, functions.php) of the tanzaku theme.
    But it seems very very difficult for me why i am starter in wordpress, php, js...

    Anybody who can help me?

  2. alvaro05
    Member
    Posted 3 years ago #

    Hi raoyop, I also don't have so much idea about php,etc so I just tried copying this here cuting that there and pasting this wherever. Someone can give you the reasons why, but what I have now in my index.php is this:

    <?php if (have_posts()) :
    	if ( $is_top_single ) $GLOBALS['more'] = false; //important
    	while (have_posts()) : the_post(); ?>
    <?php
    	$content = get_the_content('Details &raquo;');
    	$content = apply_filters('the_content', $content);
    	list($col_class, $grid_img) = adjust_grid_image(
    		$content,
    		$col_w,
    		$gap_w,
    		$max_col,
    		$flg_img_forcelink,
    		$flg_obj_fit
    	);
    ?>
    		<div <?php post_class('grid-item ' . $col_class); ?> id="post-<?php the_ID(); ?>">
    			<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    			<?php if ($grid_img) echo '<div class="grid-image">' . $grid_img . '</div>'; ?>
    			<div class="post-body">
    <?php
    	$content = preg_replace('/<img(?:[^>]+?)>/', '', $content); // remove img tags
    	$content = preg_replace('/<a([^>]+?)><\/a>/', '', $content); // remove empty a tags
    	$content = preg_replace('/<p([^>]*?)><\/p>/', '', $content); // remove empty p tags
    	$content = preg_replace('/<object(.+?)<\/object>/', '', $content); // remove object tags
    	echo $content;
    ?>
    			</div>
    			<p class="post-meta">
    			Published on <?php the_time( get_option('date_format') ); ?> <?php the_time(); ?>.<br />
    			Filed under: <?php the_category(', ') ?> <?php the_tags('Tags: ', ', '); ?>
    			<?php edit_post_link(__("Edit This"), '(', ')'); ?><br />
    			<?php /*comments_popup_link();*/ ?>
    			</p>
    		</div>
    
    <?php endwhile; else : ?>

    being replaced by this:

    <?php if (have_posts()) :
    	if ( $is_top_single ) $GLOBALS['more'] = false; //important
    	while (have_posts()) : the_post(); ?>
    		<div <?php post_class('grid-item x1' . $col_class); ?> id="post-
    <?php the_ID(); ?>">
    
    				<?php
    					if ($flg_img_extract) {
    						$content = get_the_content('');
    						$content = apply_filters('the_content', $content);
    						$content = adjust_single_image($content);
    						echo $content;
    					}
    					else {
    						the_content('');
    					}
    				?>
    
    						<h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
    		</div>
    
    <?php endwhile; else : ?>

    I hope that helps.

  3. raoyop
    Member
    Posted 3 years ago #

    Thanks for the fast answer!
    The principle of operation also want to know.... :D
    Anyway, I'm very very happy because problem be solved.
    Thank you so much!

Topic Closed

This topic has been closed to new replies.

About this Topic