我一直在寻找关于自我调用函数的信息,在某个地方我偶然发现了这个符号:
+function(){}
Run Code Online (Sandbox Code Playgroud)
有人可以向我解释一下+这个功能前面的符号意味着什么?
有没有办法在Laravel 4中获得一个分页漂亮的URL?
例如,默认情况下:
http://example.com/something/?page=3
Run Code Online (Sandbox Code Playgroud)
我想得到什么:
http://example.com/something/page/3
Run Code Online (Sandbox Code Playgroud)
此外,分页应该以这种方式呈现,并且追加分页应该以这种方式出现.
我正在使用已经设计的wordpress主题,现在我想展示WooCommerce产品(这是我自己定制的自定义帖子类型)而不是常规博客文章.
这是带有显示循环的当前查询:
<?php
$args = array(
//'posts_per_page' => '2',
'paged' => get_query_var('paged')
);
$homepage_query = new WP_Query($args);
?>
<?php //query_posts('posts_per_page=4&paged='.get_query_var('paged')); ?>
<?php if ( have_posts() ) : ?>
<?php while ( $homepage_query->have_posts() ) : $homepage_query->the_post(); ?>
<?php if($style == 'blog_style') { ?>
<div id="blog-style" class="post-box">
<?php get_template_part('content', 'blog'); ?>
</div>
<?php } else { ?>
<div class="post-box grid_4 <?php aero_post_box_class(); ?>">
<?php get_template_part('content', ''); ?>
</div>
<?php } ?>
<?php endwhile; ?>
Run Code Online (Sandbox Code Playgroud)
有没有办法添加选项,$args以便循环显示WooCommerce产品?我也在使用这个循环的分页,这在这个项目中是必需的,所以这就是使用这个循环很重要的原因.
有没有办法查询具有特定模板的Wordpress页面?这是我得到的,但没有显示任何东西:
<?php $my_query = new WP_Query(array( 'meta_key' => '_wp_page_template', 'meta_value' => 'template-city.php' )); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li>
<?php the_title(); ?>
</li>
<?php endwhile; ?>
Run Code Online (Sandbox Code Playgroud)
当然,还有名为的页面模板文件 template-city.php
我正在使用名为User Avatar的Wordpress插件,它使用Timthumb进行图像显示.当我打开页面显示图像时,它在控制台中给出错误500,当我在新选项卡中使用该图像链接时,我收到以下错误:
A TimThumb error has occured
The following error(s) occured:
Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.
Could not create cache clean timestamp file.
Query String : src=http://my.domain.com/wp-content/uploads/avatars/1/1358504649-bpfull.jpg&w=150&id=1&random=1358504649
TimThumb version : 2.8.10
Run Code Online (Sandbox Code Playgroud)
我认为这是一个服务器错误或配置错误,一切都被上传到文件夹uploads,然后进入avatars子文件夹,其中有0777权限,文件夹1也有0777.
Insinde,有两个cache和temp文件夹,都有0777权限.GD Image Lib已在服务器上启用.
我有一个有日期的记录列表(比如11/5/2013,那是一个MDY表格),但日期是VARCHAR字段.
我想选择过去30天内的所有记录,但不知道如何将它们转换为日期格式,因为我在日期字段中得到NULL.
我正在使用Laravel和Eloquent ORM,我该怎么做到这一点?
我正在尝试自定义WooCommerce结帐页面,如何编辑字段标签?
另外,如何从表单中删除2个字段?我不需要Company和State田地.
我正在使用 Laravel 4.1,并且想要强制 SSL 站点范围。我的应用程序部署在 Heroku 上。将此添加到App::before或作为过滤器:
if( ! Request::secure())
{
return Redirect::secure(Request::path());
}
Run Code Online (Sandbox Code Playgroud)
但这给了我“此网页有重定向循环”消息。如果我https://通过手动输入访问某个页面,它会正确地提供该页面;但是指向了任何链接或表单操作http://,这是我不想要的。
另外,我尝试向https某些路由添加参数,例如:
Route::get('about', ['https', function()
{
// do something
}]);
Run Code Online (Sandbox Code Playgroud)
但这会返回 404 :(
有人可以帮我吗?
为了显示我使用的小头像照片$this->itemPhoto(_someID_, 'thumb.icon'),所以'thumb.icon'参数使该方法返回小照片.什么是让SE4返回大用户照片的论点?缺乏文档使得难以弄清楚琐碎的事情.
wordpress ×4
laravel ×3
woocommerce ×3
laravel-4 ×2
php ×2
eloquent ×1
function ×1
heroku ×1
iif ×1
iife ×1
javascript ×1
operators ×1
socialengine ×1
ssl ×1
timthumb ×1