Kategori : Wordpress ...

20
06
2016

Woocommerce bulk price update

Kategorisi : Wordpress

update w_postmeta set meta_value = meta_value * 1.25 where meta_key=’_price’


28
07
2015

Tüm featured images kayıtlarını silmek

Kategorisi : Wordpress
functions.php'ye bu kodları ekliyoruz.

add_action ('init', 'remove_featured_images' );

function remove_featured_images () {

global $wpdb;
// The following query will only unset the featured image, it will not delete it.
$wpdb->query( "
    DELETE FROM $wpdb->postmeta
    WHERE meta_key = '_thumbnail_id'
" );
}

01
06
2015

Wp post_title kontrolü

Kategorisi : Wordpress

$post_if = $wpdb->get_var(“SELECT count(post_title) FROM $wpdb->posts WHERE post_title = ‘some text’”);
if($post_if < 1){
echo “var”;
} else {echo “yok”;}


04
08
2014

Toplu tarih değişimi – wp

Kategorisi : Wordpress

Toplu tarih değişimi – wordpress

UPDATE wp_posts SET post_date = ’2014-08-04 17:02:52′ WHERE post_type = ‘post’ AND ID LIKE ‘%63%’


07
07
2014

Bir kategorideki tüm yazıları silmek – sql – wp

Kategorisi : Wordpress

Bir kategorideki tüm yazıları silmek için gerekli sql kodumuz :

delete a,b,c,d
FROM w_posts a
LEFT JOIN w_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN w_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN w_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN w_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =1


27
05
2014

WordPress çifte içerikleri silmek

Kategorisi : Wordpress
SELECT a.ID, a.post_title, a.post_type, a.post_status
FROM wp_posts AS a
   INNER JOIN (
      SELECT post_title, MIN( id ) AS min_id
      FROM wp_posts
      WHERE post_type = 'post'
      AND post_status = 'publish'
      GROUP BY post_title
      HAVING COUNT( * ) > 1
   ) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'

------------------------------------------
DELETE a.*
FROM wp_posts AS a
   INNER JOIN (
      SELECT post_title, MIN( id ) AS min_id
      FROM wp_posts
      WHERE post_type = 'post'
      AND post_status = 'publish'
      GROUP BY post_title
      HAVING COUNT( * ) > 1
   ) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'

19
04
2014

WordPress postmeta da boştaki kayıtları temizlemek

Kategorisi : Wordpress
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL

18
02
2014

WordPress çifte ( duplicate ) kayıtları silmek – sql

Kategorisi : Wordpress

DELETE a.*
FROM wp_posts AS a
INNER JOIN (
SELECT post_title, MIN( id ) AS min_id
FROM wp_posts
WHERE post_type = ‘post’
AND post_status = ‘publish’
GROUP BY post_title
HAVING COUNT( * ) > 1
) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = ‘post’
AND a.post_status = ‘publish’


13
02
2014

Parent – Child 2. 3. seviye kategori eklemek wordpress-php

Kategorisi : Php,Wordpress

Her insert işleminden sonra taxonomy’i “_children” ile silmemiz gerekiyor. Mesela taxonomy = kategori ise ;

delete_option(“kategori_children”);

yazıyoruz.

wp_insert_term(
$kategori_adi,
‘category’,
array(
‘description’ => $aciklama,
//’slug’ => $slug,
‘parent’ => 0,
)
);

delete_option(“category_children”); //


10
10
2011

WordPress Canonical URL Redirection ( index.php yeniden yönlendirmeyi engellemek)

Kategorisi : Wordpress

http://ornek.com/

http://ornek.com/index.php

http://www.ornek.com/index.php

yönlendirmeyi engellemek için :
kullandığınız temadaki functions.php içerisine

remove_filter(‘template_redirect’,'redirect_canonical’);

kodunu ekliyoruz.



photo

Php, ajax, jquery, mootools web programlama. Linux, apache, lamp sunucu yönetimi. Cpanel, plesk, lxadmin panel kurulumlari.

22 / 07 / 2017, 22:48:07
Web yazilim, grafik
barbetto.com

Tunalioglu.org - 2015