jQuery 流沙 —不过滤?
所以我非常喜欢 Orman Clarke 的“Classica”wordpress 主题,但无法链接到预过滤的内容始终是一个问题。不幸的是,我在 1.1.4 版本中下载了(并找到了一些解决方案),但自从升级到 1.2 以来,我还没有能够按预期拥有流沙功能。 “全部”有效,但没有一个实际的过滤器有效 - 内容只是消失了。
1.1.4 具有流沙/jq 过滤功能,与永久链接解决方法一起使用。
我将代码直接从旧模板复制到新模板,但这并不能解决问题。我尝试并排运行两个版本并对源代码进行比较,但我看不出有什么区别。我什至系统地将文件从旧文件一一复制到新文件,看看如何解决问题。
真的有点麻烦——所以如果有人能指出我的代码中的问题所在..那将不胜感激。
http://www.colorspace.am/portfolio
另外:
我的永久链接过滤解决方案的代码如下。它要求我为每个过滤器构建一个页面,但目前已经足够了。
<h1 class="page-title">
<?php
global $post;
if(get_post_meta($post->ID, 'heading_value', true) != ''):
echo get_post_meta($post->ID, 'heading_value', true);
else:
_e('Some of my recent work.', 'framework');
endif;
?>
</h1>
<!--BEGIN #recent-portfolio .home-recent -->
<div id="recent-portfolio" class="home-recent portfolio-recent clearfix">
<?php while (have_posts()) : the_post(); ?>
<!--BEGIN .sidebar -->
<div class="sidebar">
<?php
$Path=$_SERVER['REQUEST_URI'];
if ($Path=="/portfolio")
{
echo "<h3>Filter:</h3>";
echo "<ul id=\"filter\">";
echo "<li class=\"segment-1\"><a data-value=\"all\" href=\"#\">All</a></li>";
wp_list_categories(array('title_li' => '', 'taxonomy' => 'skill-type', 'walker' => new Portfolio_Walker()));
echo "</ul>";
}
else {
echo "<a href=\"/portfolio\">← return</a>";
}
?>
<!--END .sidebar -->
</div>
<?php endwhile; ?>
<!--BEGIN .recent-wrap -->
<div class="recent-wrap">
<ul id="items" class="image-grid">
<?php
$count = 1;
$query = new WP_Query();
$query_string = 'post_type=portfolio&posts_per_page=-1&orderby=title&order=asc';
if($post->post_name != 'portfolio') $query_string .= '&skill-type=' . $post->post_name;
$query->query($query_string);
while ($query->have_posts()) : $query->the_post();
$terms = get_the_terms( get_the_ID(), 'skill-type' );
?>
<li data-id="id-<?php echo $count; ?>" class="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>">
<!--BEGIN .hentry -->
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<div class="post-thumb">
<?php tz_lightbox(get_the_ID()); ?>
</div>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>"> <?php the_title(); ?></a></h2>
<!--BEGIN .entry-content -->
<div class="entry-content">
<?php the_excerpt(); ?>
<!--END .entry-content -->
</div>
<!--END .hentry-->
</div>
<?php
$count++;
?>
</li>
<?php endwhile; wp_reset_query(); ?>
</ul>
<!--END .recent-wrap -->
</div>
<!--END #recent-portfolio .home-recent -->
</div>
So I'm totally in love with Orman Clarke's 'Classica' wordpress theme, but being unable to link to prefiltered content was always an issue. Unfortunately, I downloaded (and found somewhat of a solution) in the 1.1.4 release, but since my upgrade to 1.2, I have yet to be able to have quicksand function as intended. 'All' works, but none of the actual filters do - the content simply disappears.
1.1.4 had quicksand/jq filtering WORKING along side the permalink workaround.
I copied the code straight over from the old template to the new, but this does not resolve the issue. I've tried running both versions side by side and making a comparison of the source code, but I can see no difference. I've even systematically copied files over one by one from old to new to see what would resolve the problem.
In a bit of a pickle, really - so if anyone can point out where the issue is in my code ..that would be greatly appreciated.
http://www.colorspace.am/portfolio
Aside:
The code for my permalink filtering solution is below. It requires that I build a page for each of the filters, but it's good enough for now.
<h1 class="page-title">
<?php
global $post;
if(get_post_meta($post->ID, 'heading_value', true) != ''):
echo get_post_meta($post->ID, 'heading_value', true);
else:
_e('Some of my recent work.', 'framework');
endif;
?>
</h1>
<!--BEGIN #recent-portfolio .home-recent -->
<div id="recent-portfolio" class="home-recent portfolio-recent clearfix">
<?php while (have_posts()) : the_post(); ?>
<!--BEGIN .sidebar -->
<div class="sidebar">
<?php
$Path=$_SERVER['REQUEST_URI'];
if ($Path=="/portfolio")
{
echo "<h3>Filter:</h3>";
echo "<ul id=\"filter\">";
echo "<li class=\"segment-1\"><a data-value=\"all\" href=\"#\">All</a></li>";
wp_list_categories(array('title_li' => '', 'taxonomy' => 'skill-type', 'walker' => new Portfolio_Walker()));
echo "</ul>";
}
else {
echo "<a href=\"/portfolio\">← return</a>";
}
?>
<!--END .sidebar -->
</div>
<?php endwhile; ?>
<!--BEGIN .recent-wrap -->
<div class="recent-wrap">
<ul id="items" class="image-grid">
<?php
$count = 1;
$query = new WP_Query();
$query_string = 'post_type=portfolio&posts_per_page=-1&orderby=title&order=asc';
if($post->post_name != 'portfolio') $query_string .= '&skill-type=' . $post->post_name;
$query->query($query_string);
while ($query->have_posts()) : $query->the_post();
$terms = get_the_terms( get_the_ID(), 'skill-type' );
?>
<li data-id="id-<?php echo $count; ?>" class="<?php foreach ($terms as $term) { echo strtolower(preg_replace('/\s+/', '-', $term->name)). ' '; } ?>">
<!--BEGIN .hentry -->
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<div class="post-thumb">
<?php tz_lightbox(get_the_ID()); ?>
</div>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>"> <?php the_title(); ?></a></h2>
<!--BEGIN .entry-content -->
<div class="entry-content">
<?php the_excerpt(); ?>
<!--END .entry-content -->
</div>
<!--END .hentry-->
</div>
<?php
$count++;
?>
</li>
<?php endwhile; wp_reset_query(); ?>
</ul>
<!--END .recent-wrap -->
</div>
<!--END #recent-portfolio .home-recent -->
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
function.php 中用于过滤的代码必须用以前的版本替换(我想我使用 1.2 进行修复) - 其他文件都不需要修改。
如果我知道functions.php 已更改,我可能会先查看那里。
The code in functions.php for filtering had to be swapped out with a previous versions (I think I used 1.2's for the fix) - none of the other files required modification.
Had I have known functions.php was changed, I'd probably have looked there first.