TAUX DE TAXES 2015 TVH, TPS ET TVP Province du Canada Type de taux (TVH, TPS, TVP) Taux provincial Taux au Canada Total Alberta TPS 0% 5% 5% Colombie Britanique TPS + TVP 7% 5% 12% Île du Prince Édouard...
Category: Non classé
create filter by attribute (my code)
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'forme_shape'); foreach ($attribute->getSource()->getAllOptions(true, true) as $instance) { // $myArray] = $instance; //$productCollection_shape= $category_shape=Mage::getModel('catalog/category')->load($idcats); $productCollection_qty = $category_shape->getProductCollection() ->addAttributeToSelect(array('name', 'forme_shape')) ->addAttributeToFilter('forme_shape', array('eq' =>$instance )) ->count(); //print_r($productCollection_qty); if($productCollection_qty>0) { $myArray] = $instance; } } //print_r($myArray);
WordPress paginate_links – first page always the same as current page
I worked in wordpress created on pagination but always first page the same as current page so solution is : $pag_args1 = array( 'base' => @add_query_arg('paged1','%#%'), 'format' => '?paged1=%#%', 'current' => $paged1, 'total' => $query1->max_num_pages ); this case we attention...
wordpress Admin 添加 custom field colonne 再POST list 上
Custom columns for custom post types Published by Justin Tadlock on June 27, 2011 | 90 Responses I got a bit inspired by Joost de Valk’s post on custom post type snippets. Joost provided some code snippets for adding custom...
add cron table excute comande line for planing task
5 * * * * /usr/bin/lynx -source http://example.com/cron.php 45 * * * * /usr/bin/wget -O - -q -t 1 http://www.example.com/cron.php 45 * * * * curl -s http://example.com/cron.php
solution for qtranslate not support custom post
Add this function to function.php and wordpress will support qtranslate custom url with lang parameter function qtrans_menuitem( $menu_item ) { if ($menu_item->type == 'custom' && stripos($menu_item->url, get_site_url()) !== false){ $menu_item->url = qtrans_convertURL($menu_item->url); } return $menu_item; } add_filter('wp_setup_nav_menu_item', 'qtrans_menuitem', 0); //add...
WordPress用户权限详解
自己也笔记一下,也方便其他wordpress的用户。WordPress的用户级别分别是administrator,editor,auth,contributor和subscriber,权限和代表的意思分别是:administrator:管理员帐号 : 和Admin一样, 拥有对整个后台的所有操作权限。Editor/ 编辑者帐号: 可以对博客内的所有文章, 页面, 留言进行编辑, 可以发表文章. Author/ 作者帐号: 可以发表文章, 但只能对自己文章的进行编辑。Contributor/ 贡献者帐号: 可以投递文章, 只能对自己的文章进行编辑. 和作者帐号不同的是, 作者是一个博客的一员, 而贡献者可能是一个热心网友注册的帐号, 偶尔投递一两篇文章或评论. 但这些文章要在管理员审核之后才会被发表出来。Subscriber/ 订阅用户帐号: 对后台只有浏览功能, 以及设置自己的个人信息。更详细的wordpress用户角色权限请看下图
get currentuserinfo
Description Retrieves the information pertaining to the currently logged in user, and places it in the global variable $current_user. Properties map directly to the wp_users table in the database (seeDatabase Description). Also places the individual attributes into the following separate global...
Replace Substr in MYSQL VALUE
select * from wp_posts where ID=2;UPDATE wp_postsSET guid = REPLACE(guid, 'http://ta.leeroy.ca/', 'http://talt.leeroy.ca/')where guid like "http://ta.leeroy.ca/%" and ID=123