Tag: wordpress

jQuery.load在WPMU中给了我一个404 Not Found

我开发了一个在单个站点WP上运行良好的插件。 但是当在带有子域的WPMU上测试它时,我得到404 Not Found错误。 奇怪的是,即使我收到错误消息,内容也会被加载 – 但内容永远不会显示。 你可以在这里看到截图: http://sofzh.miximages.com/jquery/jQuery_load_error.png jQuery代码如下所示: jQuery.post(“/wp-content/plugins/wp-eventcal/eventcal_jquery.php”, { instance: ‘getEvent’, eventID: eventID }, function(event) { alert(event); // For testing – never fires }, “json”); 有关如何解决此问题的任何建议? 的.htaccess # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin […]

如何修改jquery.fancybox.pack.js文件以添加共享按钮

我有一个使用fancybox版本2.1.5的Wordpress博客,并希望添加社交分享按钮。 我在这里找到了这个例子: http : //jsfiddle.net/B9ytK/ enter code here 问题是我的fancybox .js文件是包版本,我试图用普通版本替换它以清楚地修改它,但是,每当我尝试,fancybox停止在我的博客上工作。 有没有人可以帮我修改打包的.js文件? 这是文件的下载链接。 https://www.mediafire.com/?zye76c9575hlylh 我已经使用自定义css插件添加了css代码,是否还有其他文件需要修改? 请告诉我。 提前致谢, 安德里亚

jQuery无法在WordPress中运行

我有一些jQuery脚本可以在这里找到: http : //jsfiddle.net/RUqNN/45/ 当我将这个脚本合并到我的wordpress模板中时,我无法工作。 我检查了jquery源链接,重写了代码,没有任何效果。 $(document).ready(function() { $(“.move”).toggle( function() { $(“#teetimetag”).animate({ right: “0px” }, “normal”); },function() { $(“#teetimetag”).animate({ right: “-200px” }, “normal”); }); }); Reserve your Tee-Time

jQueryfunction无法在wordpress中工作

我正在尝试在wordpress中运行一个简单的jQuery函数来隐藏和显示内容,具体取决于下拉列表,代码在wordpress之外工作正常,但是当我将它添加到我的子主题时显示所有内容。 我检查了标头并正确加载了jQuery文件。 jQuery(document).ready(function() { $(‘#id_BJ’).closest(‘article’).addClass(‘city_table’).hide(); $(‘#id_SH’).closest(‘article’).addClass(‘city_table’).hide(); $(‘#id_SZ’).closest(‘article’).addClass(‘city_table’).hide(); $(‘#id_chinese_city’).change(function() { $(‘article.city_table’).hide(); $(‘#id_’ + $(this).val()).closest(‘article’).show(); }); }); Choose first Beijing Shanghai Shenzhen Beijing Shanghai Shenzhen 我也试过使用标签,但结果是一样的 任何想法为什么会这样?

使用jQuery从img属性更改wp-caption内联样式

我正在尝试使用jQuery来修改WordPress 短代码的HTML,其HTML基本上是这样的: The caption is here. 这个(至少对我来说)的问题是,当目前的图像标题时,WordPress会向.wp-caption容器添加额外的10px。 我想将此内联样式重置为与图像的width属性相同。 我不确定这个var部分应该如何工作(或者如果有更好的方法来连接字符串),我会感谢任何正确方向的帮助: jQuery().ready(function() { jQuery(“.wp-caption”).removeAttr(“style”); var width = jQuery(“.wp-caption img”).Attr(width); var width = jQuery(width).Prepend(‘width:’); var width = jQuery(width).Append(‘px’); jQuery(“.wp-caption”).attr(‘style’, jQuery(width)); }); 更新1:现在我只需要弄清楚当页面上有多个图像时如何工作。 我尝试将它包装在.each(function(n)但它仍然从第一个图像获取宽度并将其应用于所有容器。 jQuery().ready(function() { jQuery(“.wp-caption”).each(function(n) { var width = jQuery(“.wp-caption img”).width(); jQuery(“.wp-caption”).width(width); }); }); 更新2:已解决 – 请参阅此主题 。

simple jquery.ajax返回undefined

我知道这些到处都是,但我似乎无法在代码中看到错误。 我正在使用数据类型json进行简单的ajax调用。 此调用似乎成功但不返回任何内容,并且警报打印undefined 。 JavaScript的: jQuery(document).ready(function() { if(jQuery(‘#statesel’).length) { var dataString; dataString = “nonce=” + dynoselect.post_dyno_select_nonce; jQuery.ajax({ type: “POST”, url: dynoselect.ajaxurl, dataType: “json”, data: dataString, success: function(result) { alert(result.status); } }); } } PHP: admin_url(‘admin-ajax.php’), ‘post_dyno_select_nonce’ => wp_create_nonce(‘dyno_select_nonce’))); wp_enqueue_script(‘jquery’); wp_enqueue_script(‘dyno_select_script’); } function dyno_select() { $nonce = $_POST[‘nonce’]; //checking token, looking for funny business if (!wp_verify_nonce( […]

Flexslider中每张幻灯片的不同下一个和上一个文本

我使用wordpress自定义post创建了一个flexslider。 我总共有6个post,6个幻灯片从这些post的内容中提取出来。 我需要将“下一个”和“上一个”的文本更改为幻灯片中下一个和上一个post的标题。 这是我目前使用的jQuery代码: $(‘#ethosBotSection’).flexslider({ animation: “slide”, slideToStart: 0, useCSS: false, controlNav: true, directionNav: false, slideshow: false, manualControls: ‘.ethosNav li’, start: function(slider) { $(‘.ethosNav li’).click(function() { $(‘.flexslider’).show(); var slideTo = $(this).attr(“rel”) var slideToInt = parseInt(slideTo) if (slider.currentSlide != slideToInt) { slider.flexAnimate(slideToInt) } }); } }); 感谢和问候

在wordpress上手动安装nivoslider无法正常工作

我试图手动将nivoslider安装到wordpress主题,所以我可以添加nivoslider作为主题选项面板的选项。 最初我只是需要它来处理硬编码图像,但我一直得到这个js错误$(“#slider”)。nivoSlider不是一个函数。 包含Nivo滑块,路径正在运行到文件,jquery版本1.7.1。 文件的两个路径都在工作,因此包含了所有必需的js。 我将在浏览器中渲染后粘贴整个标题。 文件路径是本地的,因此无法从外部访问 <?php /** * The Header for our theme. * * Displays all of the section and everything up till * * @package WordPress * @subpackage GPSite * @since Starkers 3.0 */ global $theme_shortname; global $mm; $mm = get_option($theme_shortname.”_maintenance_mode”); // If maintenance mode is on and we’re not on the […]

jQuery滑块左右按钮,firefox不起作用

我做了这个wordpress主题,水平显示循环:http: //zarifnyc.com/category/news/ var curx = $(‘#blog’).css(”); if(curx = 25000) {hide(‘#rightbutton’)} else {show(‘#rightbutton’)} $(function() { $(‘#rightbutton’).click(function() { $(‘#blogbox’).animate({“left” : ‘-=1070px’}); return false; }); $(‘#leftbutton’).click(function() { $(‘#blogbox’).animate({“left” : ‘+=1070px’}); return false; }); }); …它一直工作,直到我尝试添加一个“if”语句来隐藏第一个post上的左键,然后右键(或使用无限滚动)。 ‘刚刚开始学习jQuery,所以任何帮助都会受到赞赏,谢谢!

WordPress儿童主题包括包含文件

我正在使用AMPPS作为本地主机在本地计算机上进行WordPress设置。 使用Delta主题我创建了一个子主题(delta2-child)。 初始设置很有效。 但是,我需要更改名为home-slider.php的includes文件夹中的文件。 原始文件的位置: c:\Program Files (x86)\Ampps\www\armstrong\wp-content\themes\delta\includes\home-slider.php 子主题文件的位置: c:\Program Files (x86)\Ampps\www\armstrong\wp-content\themes\delta2-child\includes\home-slider.php 如果我将home-slider文件移动到Child Theme文件夹[delta2-child \ includes \ home-slider.php],主题仍然使用Parent Themes主滑块文件。 如果我将以下内容添加到CT的functions.php文件中: require_once( get_stylesheet_directory_uri() . “/includes/home-slider.php” ); */ 我收到以下错误: Warning: require_once(C:\Program Files (x86)\Ampps\www\armstrong/wp-content/themes/delta/includes/home-slider.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files (x86)\Ampps\www\armstrong\wp-content\themes\delta2-child\header.php on line 87 Fatal error: require_once() [function.require]: Failed opening required […]