小编Cra*_*aig的帖子

Wordpress自定义帖子类型层次结构和菜单突出显示(current_page_parent)

我创建了一个自定义帖子类型的"投资组合"和页面,其中包含一个模板,用于检索与该自定义帖子类型匹配的所有帖子.

问题是当我深入到实际帖子时,帖子似乎位于主菜单突出显示的"博客"下面(将current_page_parent显示为一个类)

永久链接网址是正确的:www.site.com/portfolio/post-slug

但菜单认为父母是"博客".

这显然是一个等级问题,但我不知道如何解决它.

wordpress menu highlight hierarchical custom-post-type

9
推荐指数
2
解决办法
1万
查看次数

event.stopPropagation()在使用jQuery 1.7的chrome中不起作用

出于某种原因,单击文档无法在Chrome中运行(未调用closeQuickView).

元素是通过AJAX加载的,因此需要有.on()动作(以前的.live()现在已经在jQuery 1.7中弃用了)

使用此处给出的示例:如何检测元素外部的单击?作为基础

$('html').on('click', '.poster:not(.active) .image-effect', function (event) {

        var obj = $(this).parent();

        // If there are no .close spans
        if (obj.find('.close').length === 0) {

            // Add the close element by javascript to remain semantic
            obj.find('.quick-view').append('<span class="close">&times;</span>');
        }

        // Close any open Quick Views
        closeQuickView();

        // Add the active class (controls opacity)
        obj.addClass('active');

        // Fade in the Quick View
        obj.find('.quick-view').fadeIn(200, 'easeInOutQuint');

        event.preventDefault();
        event.stopPropagation();

    });

    $('html').on('click', '.active', function () {
        return false;
    });

    $('html').on('click', '.close', function …
Run Code Online (Sandbox Code Playgroud)

javascript jquery html5 event-propagation stoppropagation

4
推荐指数
1
解决办法
1万
查看次数

jQuery Masonry回调无法正常工作

我正在尝试在jQuery Masonry完成定位魔术时执行回调函数,以防止代码中出现无格式内容.

但是,出于测试的目的,我使用的是一个根本没有调用的简单警报.

var $jigsaw = $('#jigsaw');

$jigsaw.imagesLoaded( function(){
    $jigsaw.masonry({
     columnWidth : 180,
      isAnimated : !Modernizr.csstransitions,
     isResizable : true,
    itemSelector : '.piece'
    }, function(){
        alert('Completed');
    });
});
Run Code Online (Sandbox Code Playgroud)

我可能会遗漏一些明显的东西,但任何帮助都会受到赞赏

jquery callback jquery-callback fouc jquery-masonry

3
推荐指数
1
解决办法
1万
查看次数

由于gem安装失败,无法安装中间人

我试图安装中间人使用bundle install,并得到如下:

Installing eventmachine 1.0.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/var/rbenv/versions/2.1.7/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in …
Run Code Online (Sandbox Code Playgroud)

gem bundler middleman

0
推荐指数
1
解决办法
916
查看次数