Skip to content

Instantly share code, notes, and snippets.

View ozlemcimen's full-sized avatar

Ozlem Cimen ozlemcimen

View GitHub Profile
<?php
include __DIR__.'/wp-load.php';
// Get all category of wordpress site.
// Categories are actually term located in `wp_terms` table.
$categories = get_terms();
// This will fetch all categories of all post type of the site.
@ozlemcimen
ozlemcimen / flatsome3-custom-post-type-support.php
Created July 22, 2020 13:44 — forked from webseo-onilne/flatsome3-custom-post-type-support.php
Integrate custom post types into Flatsome 3 page builder application using a child theme; providing: (1.) Page Builder Editor support for custom post types, and (2.) Integration with page builder post element components.
<?php
/**
* Integrate custom post types into Flatsome 3 page builder application using a child theme.
*
* This will provide:
*
* 1. Page Builder Editor support for custom post types
* 2. Integration with page builder post element components
**/
@ozlemcimen
ozlemcimen / .htaccess
Created May 22, 2020 14:59 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
<?php
function wolinka_auto_delete_of_post_thumbnail($post_id) {
if(has_post_thumbnail( $post_id )){
$attachment_id = get_post_thumbnail_id( $post_id );
wp_delete_attachment($attachment_id, true);
}
}
add_action( 'before_delete_post', 'wolinka_auto_delete_of_post_thumbnail', 10 );
?>
@ozlemcimen
ozlemcimen / social_media_share.css
Last active December 18, 2017 05:29
Single.php için sosyal medya paylaşım butonları fonksiyon, script ve css dosyası
.fa {
color: #fff;
}
.social-media-share {
padding: 10px 0;
margin-bottom: 20px;
}
.social-media-share a {
<?php
// Fatura Adresi kısmına vergi dairesi ve vergi numarası özel alanlarını ekler.
function wolinka_billing_custom_checkout_fields( $fields ) {
$fields['billing']['billing_vergi_dairesi'] = array(
'label' => __('Vergi Dairesi', 'woocommerce'),
'priority' => 35,
'required' => false,
'class' => array('form-row form-row-first'),
'clear' => true
@ozlemcimen
ozlemcimen / woo_free_shipping.php
Created December 5, 2017 21:13
WooCommerce içerik sayfalarında, sepete ekle butonu öncesi yazı ekler
<?php
//WooCommerce içerik sayfalarında, sepete ekle butonu öncesi yazı ekler
function wolinka_free_shipping() {
echo '<div class="free-shipping">Ücretsiz Kargo</div>';
}
add_action( 'woocommerce_single_product_summary', 'wolinka_free_shipping', 20 );
?>
@ozlemcimen
ozlemcimen / woo_remove_reviews_product_tabs.php
Last active December 4, 2017 14:53
WooCommerce sayfalarında yorum sekmesini kaldırır.
<?php
function wolinka_remove_reviews_product_tabs( $tabs ) {
unset( $tabs['reviews'] );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wolinka_remove_reviews_product_tabs', 98 );
?>
@ozlemcimen
ozlemcimen / woo_remove_product_tabs.php
Last active December 4, 2017 14:47
WooCommerce ürün sekmelerini kaldırır
<?php
function wolinka_remove_product_tabs( $tabs ) {
unset( $tabs['description'] );
unset( $tabs['reviews'] );
unset( $tabs['additional_information'] );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wolinka_remove_product_tabs', 98 );
@ozlemcimen
ozlemcimen / woo_rename_tab.php
Last active December 5, 2017 07:32
WooCommerce ürün sekmelerini yeniden adlandırır.
<?php
function wolinka_rename_tab ($tabs) {
$tabs['description']['title'] = 'Açıklama';
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'wolinka_rename_tab', 98);
?>