Skip to content

Instantly share code, notes, and snippets.

View serkanalgur's full-sized avatar
🇹🇷
🇦🇿 Selam / Salam / Hi!

Serkan Algur serkanalgur

🇹🇷
🇦🇿 Selam / Salam / Hi!
View GitHub Profile
@serkanalgur
serkanalgur / custom-post-taxonomy-permalinks.php
Created September 13, 2018 12:29 — forked from kasparsd/custom-post-taxonomy-permalinks.php
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
<?php
/*
Term Archive Pages:
- http://example.com/recipes/dinner/
- http://example.com/recipes/breakfast,brunch/
Single Recipe Pages:
- http://example.com/recipes/dinner/soup-title/
@serkanalgur
serkanalgur / responsive_960grid.css
Created October 26, 2018 13:56 — forked from adamjohnson/responsive_960grid.css
The Responsive 960 Grid System, Beta v0.6
/* Begin 960.css 12 and 16 column minified, 10-27-10 via 960-Grid-System at GitHub
* Licensed under GPL and MIT licenses, just like the original 960 Grid
* Adaptive media queries created by Adam Johnson. @adamj_design | http://adamjohnsondesign.com
*/
body{min-width:960px}.container_12,.container_16,.container_24{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16,.grid_17,.grid_18,.grid_19,.grid_20,.grid_21,.grid_22,.grid_23,.grid_24{display:inline;float:left;margin-left:10px;margin-right:10px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15{position:relative}.container_12 .grid_3,.container_16 .grid_4{width:220px}.container_12 .grid_6,.container_16 .grid_8{width:460px}.containe
@serkanalgur
serkanalgur / .htaccess
Last active September 13, 2023 08:50 — forked from seoagentur-hamburg/.htaccess
UPDATE 2021: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2019
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://andreas-hecht.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################

Keybase proof

I hereby claim:

  • I am serkanalgur on github.
  • I am serkanalgur (https://keybase.io/serkanalgur) on keybase.
  • I have a public key ASAv-TnWF_KlWby-B56ClRSqfy6R4Hb7MpgzgqPk0XX_9Ao

To claim this, I am signing this object:

@serkanalgur
serkanalgur / create_json_extract.sql
Last active June 18, 2021 08:26
json_extract and json_unquote creator functions for Mysql < 5.7 . If you use translatable texts with Laravel you can use this. (I was forced to use Laravel with cPanel built with MySQL 5.6)
DELIMITER $$
CREATE FUNCTION `json_extract`(`details` TEXT, `required_field` VARCHAR(255)) RETURNS text CHARSET utf8mb4
BEGIN
RETURN TRIM(
BOTH '"' FROM SUBSTRING_INDEX(
SUBSTRING_INDEX(
SUBSTRING_INDEX(
details,
CONCAT(
'"',
<?php
/**
* Yazı İsmi : 30 Günden Eski Mesajlarınıza Yorum Yapılmasını Engellemek
* Yazı Linki : https://wpadami.com/cms-sistemleri/wordpress/30-gunden-eski-mesajlariniza-yorum-yapilmasini-engellemek.html
*/
function close_comments($posts)
{
if (!is_single()) {
<?php
if (function_exists('register_sidebar')) {
register_sidebar([
'name' => 'Sol bilesen',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
]);
<?php
/**
* Yazı Adı : Geçmiş Yazıları ve Ortam Dosyalarını Otomatik Silmek
* Yazı Linki : https://wpadami.com/cms-sistemleri/wordpress/gecmis-yazilari-ortam-dosyalarini-otomatik-silmek.html.
**/
// Kodu lütfen dikkatli kullanın. Saygılarımla, Serkan Algur :)
// Kod başlasın
function delete_oldest_posts_salgur()
@serkanalgur
serkanalgur / open_and_read_file.go
Created November 25, 2020 20:46
Open and Read File using phpfuncs module
package main
import (
"fmt"
"os"
"github.com/serkanalgur/phpfuncs"
)
func main(){
@serkanalgur
serkanalgur / random-color-user.php
Created July 6, 2021 13:47
Random colored user backgrounds with auto color calculation
<?php
/** Random Color Part Generator HEX **/
function RandomColorPart()
{
return mt_rand(0, 255);
}
/** Random Color Part Generator **/