我正在编辑最新的wordpress附带的标准二十三主题.
我需要在wp_head中添加一些我自己的.css文件,但我不知道该怎么做.我目前在wp_head之外调用我的文件,但这很麻烦,并且想要正确地完成它.
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo("template_url"); ?>/bootstrap.css" />
<script type="text/javascript" src="<?php bloginfo("template_url"); ?>/js/bootstrap.min.js"></script>
<?php wp_head(); ?>
Run Code Online (Sandbox Code Playgroud)
在哪里定义wp_head的内容以及如何添加自己的内容?
我有一个计数器,动画到HTML中定义的最终数字.但是我希望这个动画一旦在视口中就会发生.
$(document).ready(function() {
$(function($, win) {
$.fn.inViewport = function(cb) {
return this.each(function(i, el) {
function visPx() {
var H = $(this).height(),
r = el.getBoundingClientRect(),
t = r.top,
b = r.bottom;
return cb.call(el, Math.max(0, t > 0 ? H - t : (b < H ? b : H)));
}
visPx();
$(win).on("resize scroll", visPx);
});
};
}(jQuery, window));
$(".fig-number").inViewport(function(px) {
$(this).each(function() {
$(this).prop('Counter', 0).animate({
Counter: $(this).text()
}, {
duration: 1000,
step: function(now) {
$(this).text(Math.ceil(now));
}
}); …Run Code Online (Sandbox Code Playgroud) 我有一个用于我的body和链接的自定义图像光标。
我想要实现的是将光标悬停在链接上,光标应该转换为链接的光标图像,而不是立即更改。
目前,我有这个代码:
html {
height:100%;
}
body {
cursor:url(https://i.imgur.com/odlAwsz.png), auto !important;
width:100%;
height:100%;
background:red;
}
a {
cursor:url(https://i.imgur.com/yxX4Snm.png), auto !important;
}Run Code Online (Sandbox Code Playgroud)
<a href="#">I'm a link</a>Run Code Online (Sandbox Code Playgroud)
正如您在上面看到的,当悬停时,两个圆圈图标之间没有过渡<a>。
我尝试用 CSS 实现这一点,但没有成功。如何使用 JavaScript 实现这一点?
我目前正在使用Flickity传送带来创建具有不同影片内容面板的传送带。
轮播使用一种自定义导航来控制它,而不是轮播随附的标准导航。但是,当您到达轮播幻灯片的末尾时,我正努力禁用下一个导航按钮。这是我正在尝试实现并基于此的代码的示例。
从我的示例中,您将看到“上一步”按钮可以正常工作,并且在您首次落入轮播时被禁用。但是,到达终点时,永远不会禁用“下一步”按钮。
这是一个JSFiddle
我的代码:
$(document).ready(function () {
$('.carousel-container').each(function (i, container) {
var options = {
cellAlign:'left',
groupCells:'3',
pageDots: false,
prevNextButtons: false
};
$('.carousel__slides').flickity(options);
var $container = $(container);
var $slider = $container.find('.carousel__slides');
var flkty = $slider.data('flickity');
var selectedIndex = flkty.selectedIndex;
var slideCount = flkty.slides.length;
var $prev = $container.find('.prev');
var $next = $container.find('.next');
// previous
$prev.on('click', function () {
$slider.flickity('previous');
});
// next
$next.on('click', function () {
$slider.flickity('next');
});
$slider.on( …Run Code Online (Sandbox Code Playgroud)所以我试图做到这一点,然后当你点击旋转木马中的一个链接时,它会将你向下滚动到页面内容.
这是我的jquery:
$('#picks li a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
Run Code Online (Sandbox Code Playgroud)
但是我在我的控制台中收到此错误错误:语法错误,无法识别的表达式:http://hutchcreative.co.uk/rod/other/#galleryDetails
这是正确的链接位置,但不知道如何纠正它,以便jquery添加幻灯片?
谢谢!
我正在使用jQuery在悬停时创建一个简单的addClass.将鼠标悬停在#science-panel-numberdiv上会触发一个.active要添加到#iphone-screen-numberdiv的类.
这是我的jQuery:
$('#science-panel-1').hover(function(){
$('#iphone-screen-1').addClass('active');
},function(){
$('#iphone-screen-1').removeClass('active');
});
$('#science-panel-2').hover(function(){
$('#iphone-screen-2').addClass('active');
},function(){
$('#iphone-screen-2').removeClass('active');
});
$('#science-panel-3').hover(function(){
$('#iphone-screen-3').addClass('active');
},function(){
$('#iphone-screen-3').removeClass('active');
});
Run Code Online (Sandbox Code Playgroud)
我的HTML:
<div class="col-md-4">
<div id="science-panel-1" class="science-panel__item">
Content goes in here!
</div>
<div id="science-panel-2" class="science-panel__item">
Content goes in here!
</div>
<div id="science-panel-3" class="science-panel__item">
Content goes in here!
</div>
</div>
<div class="col-md-4">
div id="iphone-screen-1" class="iphone-screen-item">
<img src="IMG-url-here.jpg" alt="" />
</div>
div id="iphone-screen-2" class="iphone-screen-item">
<img src="IMG-url-here.jpg" alt="" />
</div>
<div id="iphone-screen-3" class="iphone-screen-item">
<img src="IMG-url-here.jpg" alt="" />
</div>
<div id="iphone-screen-4" class="iphone-screen-item"> …Run Code Online (Sandbox Code Playgroud) 我在以前曾经使用过很多次的网站上使用Bootstrap.但是我似乎在右侧增加了空间,我无法弄清楚它来自哪里.
你可以在这里查看网站hutchcreative.co.uk和在你的计算机上测试手机的好方法是使用谷歌扩展移动测试.
我的第一个想法是它可能是旋转木马,但是如果我去博客我仍然有问题.它仅适用于移动版(在平板电脑上运行良好),我不记得它总是在发生.
我试图将我的wordpress网站移动到另一个托管.我已导出数据库,我将其重新导入主机.数据库确实有不同的名称,但我已更新该文件.
这是我尝试导入时收到的错误:
错误
SQL查询:
CREATE TABLE IF NOT EXISTS `wp_commentmeta` (
`meta_id` bigint( 20 ) unsigned NOT NULL AUTO_INCREMENT ,
`comment_id` bigint( 20 ) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar( 255 ) DEFAULT NULL ,
`meta_value` longtext,
PRIMARY KEY ( `meta_id` ) ,
KEY `comment_id` ( `comment_id` ) ,
KEY `meta_key` ( `meta_key` )
) TYPE = MYISAM AUTO_INCREMENT =17;
Run Code Online (Sandbox Code Playgroud)
MySQL说:文档
#1064 - 您的SQL语法有错误; 检查与您的MySQL服务器版本对应的手册,以便在第9行'TYPE = MyISAM AUTO_INCREMENT = 17'附近使用正确的语法
我在这里看了一下,很多人说这是因为Add CREATE PROCEDURE/ FUNCTION/ EVENT语句需要滴答作响,但我已经这样做了.