This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$urls.base_url} -> Store address | |
{$urls.current_url} -> Current address (url) where we are | |
{$urls.shop_domain_url} -> Store domain | |
{$urls.img_ps_url} -> Image root directory url | |
{$urls.img_cat_url} -> Url directory of images of the categories | |
{$urls.img_lang_url} -> Url of the language images directory | |
{$urls.img_prod_url} -> Url of the product images directory | |
{$urls.img_manu_url} -> Url directory of manufacturers images | |
{$urls.img_sup_url} -> Url of the providers directory | |
{$urls.img_ship_url} -> Url directory of images of carriers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.id,tt.term_id | |
FROM ( | |
SELECT p.id | |
FROM `wp_posts` p | |
join `wp_term_relationships` tr on p.id=tr.object_id and p.post_type='post' | |
join `wp_term_taxonomy` tt on tr.term_taxonomy_id=tt.term_taxonomy_id and tt.taxonomy='category' ) | |
as p | |
JOIN wp_term_relationships tr ON tr.object_id = p.ID | |
JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id and tt.taxonomy = 'category' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.id, p.post_title, p.post_name, p.post_parent, | |
(select pp.post_name from wp_posts pp where pp.id = p.post_parent) as parent_name | |
FROM `wp_posts` p | |
join `wp_term_relationships` tr on p.id=tr.object_id and p.post_type='post' | |
join `wp_term_taxonomy` tt on tr.term_taxonomy_id=tt.term_taxonomy_id and tt.taxonomy='category' and tt.term_id = <ID> | |
order by p.post_parent, p.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t.term_id, t.name, count(tr.object_id), t.slug | |
FROM `wp_term_relationships` tr | |
join `wp_term_taxonomy` tt on tr.term_taxonomy_id=tt.term_taxonomy_id and tt.taxonomy='category' | |
join `wp_terms` t on t.term_id=tt.term_id | |
group by t.name | |
order by t.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Substitute # for site ID: | |
insert into wp_#_postmeta (post_id,meta_key,meta_value) | |
select p.id,'_thumbnail_id',min(a.id) | |
from wp_#_posts p | |
join wp_#_posts a on (a.post_type = 'attachment' and a.post_parent=p.id) | |
where p.post_type = 'post' | |
and p.id not in (select post_id from wp_#_postmeta where meta_key='_thumbnail_id') | |
group by p.id; |