是否有必要拥有有效的CSS?我正在使用Twitter Bootstrap进行快速Web开发,在通过W3C CSS Validator运行两个主要的Bootstrap样式表之后,我发现了大约600个错误.
我的问题是,我的网站看起来不错,为什么CSS有效这么重要?
我正在使用Ladda在我的表单按钮上引入一些加载效果.请参阅Ladda演示
我正在使用的效果是zoom-out.这有效但旋转器没有显示.有什么我想念的吗?
我的按钮:
<button type="submit" class="ladda-button" data-style="zoom-out" name="submit">
<span class="ladda-label">Submit</span>
<span class="ladda-spinner"></span>
</button>
Run Code Online (Sandbox Code Playgroud)
我的JS脚本(取自此处):
var buttons = document.querySelectorAll( '.ladda-button' );
Array.prototype.slice.call( buttons ).forEach( function( button ) {
var resetTimeout;
button.addEventListener( 'click', function() {
if( typeof button.getAttribute( 'data-loading' ) === 'string' ) {
button.removeAttribute( 'data-loading' );
}
else {
button.setAttribute( 'data-loading', '' );
}
clearTimeout( resetTimeout );
resetTimeout = setTimeout( function() {
button.removeAttribute( 'data-loading' );
}, 3000 );
}, false );
} ); …Run Code Online (Sandbox Code Playgroud) 我给了我的Bootstrap 3模态一个'淡入淡出'类但是模态不会像我期望的那样"淡入淡出".它似乎从上面滑入,而不是淡入.
莫代尔:
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
触发按钮:
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
Run Code Online (Sandbox Code Playgroud)
为了展示我如何期待"淡入淡出"效果的示例,我创建了这个示例:http: //jsfiddle.net/spQp5/
我怎样才能让我的模态像这样"淡入淡出"?
在一个特定用户的WordPress文章发布中发现1个奇怪的问题.
内容没有问题,因为我试图在新帖子中复制并粘贴此内容,并且工作正常.
它不会发生在所有用户身上.还有1点在Visual模式下加载的图标比在Admin帐户中少得多.
嘿,我已经能够编写一个nsIStreamListener监听器来监听响应,并在nsitraceablechannel-intercept-http-traffic的教程后获取响应文本.但是我无法修改发送给浏览器的响应.实际上,如果我返回响应并发送回到连锁店,它反映在萤火虫中,但不是在浏览器中.
我猜测的是我们将不得不替换默认监听器而不是在链中监听.我无法在任何地方获得任何解释如何执行此操作的文档.
任何人都可以给我一些洞察力.这主要是为了教育目的.
提前致谢
编辑:截至目前,我已经达成了一些解决方案,我能够做到这一点
var old;
function TracingListener() {}
TracingListener.prototype = {
originalListener: null,
receivedData: null, //will be an array for incoming data.
//For the listener this is step 1.
onStartRequest: function (request, context) {
this.receivedData = []; //initialize the array
//Pass on the onStartRequest call to the next listener in the chain -- VERY IMPORTANT
//old.onStartRequest(request, context);
},
//This is step 2. This gets called every time additional data is available
onDataAvailable: function (request, …Run Code Online (Sandbox Code Playgroud) WordPress中的标准作者链接如下所示: example.com/author/johnsmith
我想删除author/URL 的一部分,以便用户名在根目录中.例如:example.com/johnsmith
我在我的网站上控制页面创建,因此页面和作者姓名不会发生冲突.
到目前为止,我已经尝试了WP Snippet的以下解决方案,但这似乎不再起作用:
add_filter('author_rewrite_rules', 'no_author_base_rewrite_rules');
function no_author_base_rewrite_rules($author_rewrite) {
global $wpdb;
$author_rewrite = array();
$authors = $wpdb->get_results("SELECT user_nicename AS nicename from $wpdb->users");
foreach($authors as $author) {
$author_rewrite["({$author->nicename})/page/?([0-9]+)/?$"] = 'index.php?author_name=$matches[1]&paged=$matches[2]';
$author_rewrite["({$author->nicename})/?$"] = 'index.php?author_name=$matches[1]';
}
return $author_rewrite;
}
add_filter('author_link', 'no_author_base', 1000, 2);
function no_author_base($link, $author_id) {
$link_base = trailingslashit(get_option('home'));
$link = preg_replace("|^{$link_base}author/|", '', $link);
return $link_base . $link;
}
Run Code Online (Sandbox Code Playgroud)
有谁知道这是否有一个有效的解决方案?
我正在我的 WordPress 网站上的自定义注册表单中获取用户名、电子邮件和密码。我正在清理用户名sanitize_user()并sanitize_email()清理电子邮件地址。
例如:
$username = sanitize_user( $username );
$email = sanitize_email( $email );
Run Code Online (Sandbox Code Playgroud)
我应该如何清理用户输入的密码?我能想到的只是,sanitize_text_field( $pass )但我确定这不是正确的方法。
参考:
我正在使用Plupload让用户将图像上传到我的WordPress网站.
当用户点击"选择文件"并从手机图库中选择图像时,图像的文件名将显示在屏幕上.然后,用户可以自由点击"上传文件"以开始上传.
我的问题
当用户点击"选择文件"并使用他们的照相手机拍照时,图像的文件名不会出现在屏幕上.在这种情况下,当用户现在尝试单击"上载文件"时,没有任何反应.我该如何解决这个问题?
笔记
当我使用平板电脑或台式机时,问题根本不会发生.
更新
我的测试是使用两个移动设备完成的:
这是我正在使用的代码的演示:http://jsfiddle.net/djydce90/
我的剧本
var uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,html4',
browse_button : 'pickfiles',
container: document.getElementById( 'container' ),
url : "/examples/upload",
filters : {
max_file_size : '10mb',
mime_types: [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
},
flash_swf_url : '/plupload/js/Moxie.swf',
silverlight_xap_url : '/plupload/js/Moxie.xap',
init: {
PostInit: function() {
document.getElementById('filelist').innerHTML = '';
document.getElementById('uploadfiles').onclick …Run Code Online (Sandbox Code Playgroud) 您可以为生成的TinyMCE textarea设置占位符文本wp_editor()吗?
http://codex.wordpress.org/Function_Reference/wp_editor
我的代码目前是:
$settings = array( 'media_buttons' => false );
wp_editor( $content, $editor_id, $settings );
Run Code Online (Sandbox Code Playgroud)
这会产生一个带有所有铃声和口哨声的文本区域,例如TinyMCE按钮和Quicktags,但我看不出如何设置占位符文本.使用标准文本区域,您可以这样做:
<textarea name="content" placeholder="Write something"></textarea>
Run Code Online (Sandbox Code Playgroud) 我正在努力摆脱WordPress 3.8.1上的错误.
它说,每当我尝试将媒体上传到帖子时,它都不会添加An error occurred in the upload. Please try again later..
但更奇怪的是,即使在此问题之后,它也会显示在仪表板/媒体/库中.
我也看不到上传的附加媒体到我的帖子(编辑帖子/ [添加媒体按钮])/媒体库/上传到这篇文章,但在仪表板/媒体/库部分,这些旧的上传图像显示正确显示上传到什么帖子.
我试过以下几点:
wp-includes和wp-admin文件夹并手动替换它们.wp-content/uploads文件夹的chown和chmod .为了确保它们正常工作,我删除了wp-content/uploads/2014文件夹,并在首次上传后显示此错误,该文件夹是使用右chown和chmod创建的,文件在那里(wp-content/uploads/2014/01/26/file with resolutions.jpg)WP_DEBUG定义true,我甚WP_DEBUG_DISPLAY至已经定义了true,没有任何帮助.wp-admin/media-new.php,使用多上传器,文件在" Crunching…"步骤冻结,但旧浏览器上传工作完美无缺.safe_mode被设为off.mod_security我的php.ini中没有选项.我upload_max_filesize在php.ini被设置为20M,memory_limit是256M,只有3个站点都托管和记忆是相当空的,而测试这些.即使使用50kb .jpg图像也会发生这种情况,所以这不应该相关.AddType x-mapp-php5 .php .php4到这里.htaccess建议的结尾,这根本没有帮助. …