Skip to content

Instantly share code, notes, and snippets.

View metinsaylan's full-sized avatar
🤘
rocking on!

Metin Şaylan metinsaylan

🤘
rocking on!
View GitHub Profile
@metinsaylan
metinsaylan / get-posts-by-category-name.sql
Created December 21, 2023 22:55
SQL Query to Get WordPress Posts Using Category Name
-- SQL Query to Get WordPress Posts Using Category Name
select p.id, p.post_title from wp_posts p
inner join wp_term_relationships tr on tr.object_id = p.ID
inner join wp_terms t on tr.term_taxonomy_id = t.term_id
inner join wp_term_taxonomy tt on tt.term_taxonomy_id = t.term_id
where post_status ='publish'
and tt.taxonomy = 'category'
and t.name = 'Featured'
@metinsaylan
metinsaylan / get-post-using-id.php
Created December 21, 2023 22:35
Get WordPress Post Content by Post ID
<?php
$post_id = 123; // Replace with the actual Post ID
$post = get_post( $post_id );
if ( $post ) {
$post_content = apply_filters( 'the_content', $post->post_content );
echo $post_content;
} else {
echo 'Post not found';
@metinsaylan
metinsaylan / framebuster.html
Created April 4, 2022 08:05
Frame buster script - removes iframes around your site
<script>!function(){var x=!1;try{x=top.location.host!=location.host}catch(t){x=1}x&&(top.location=location)}();</script>
@metinsaylan
metinsaylan / lazy-tube.css
Created September 16, 2021 22:06
Lazy-load Youtube Videos
.llv{min-height:350px;position:relative}.llv:after{content:"Click/Tap to Load Video";background-position:center;background-repeat:no-repeat;text-align:center;width:100%;height:100%;background-color:rgba(0,0,0,.3);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAtCAYAAAAeA21aAAACXUlEQVR4Ae3aA4xcURSA4VfbVsy6caMyqG3btuPUtm27DWpzbds2Tv9b2zPzdt89ybfeuXn/eOYaUqfOzxlGMdREE7RDf0zGUqzFHpzCVdzGYzjBE34IQSRikYDk99KR+V76Zz9PQCwiEQI/eMEJT3AHV3EKe7EOyzAFA9AeTVELxX91fD866IoYimN4jUhkQAqITETBGScxClV+L4BhdEcQpJCJwMCfBzCM6ZBCbsn3AxhGF4hFDPwygGGUhgvEIvxR+fMA3SEWM/TzAFsgFnPk8wAPIBbjLDVqFFcBqvFNKMRiEgjQQAVo+uFBjsXkE6ClCtBJ/cCKCNBPBRhr84WKFjVrgJkqwDKbLzR+vMjChSIlS5otwCoVYLPNF1qyRNSIk5NIx45mCrBPBThm84UWL5Yv5soVkSZNzBDgvApwze4B1GRliWzaJFKrliMD3FYB7jkkwIeJiRGZPl2kVClHBHimArx0aIAP4+4u0q2bvQO4qQDupgjwYW7eFGnRwl4BfFUAX1MFUJOTI7Jjh0jdurYOEKQCBJkuwIeJjxeZN0+kYkVbBQhTAYJNG+DDnDwpUqyYLQKE60uAvg3Q9wL6cYDjHwnOmCFSurRDHgnq5wL62aB+PUC/ImTp1wT1q8L6fQH9zpB+b9Cy7w7r/QF6h4jeI6R3iel9gr/YKXocTohCFqSAyEIMXHAKo3+2U/TnypYthhpohNbo
@metinsaylan
metinsaylan / circles-loader.css
Created September 8, 2021 13:18
Loading circle animated background CSS
.bg-c {
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-color: var(--cg);
border-radius: 6px;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzAwMCIgdmlld0JveD0iMCAwIDUwIDUwIj48cGF0aCBkPSJNNSwyNSBhMSwxIDAgMCwwIDQwLDAiIHRyYW5zZm9ybT0icm90YXRlKDE4NC4yMiAyNSAyNSkiPjxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZVR5cGU9InhtbCIgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGZyb209IjAgMjUgMjUiIHRvPSIzNjAgMjUgMjUiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iLS42cyI+PC9hbmltYXRlVHJhbnNmb3JtPjwvcGF0aD48cGF0aCBkPSJNMTAsMjUgYTEsMSAwIDAsMCAzMCwwIiB0cmFuc2Zvcm09InJvdGF0ZSgzMjAuMjc0IDI1IDI1KSI+PGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlVHlwZT0ieG1sIiBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZnJvbT0iMCAyNSAyNSIgdG89IjM2MCAyNSAyNSIgZHVyPSIuOHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIj48L2FuaW1hdGVUcmFuc2Zvcm0+PC9wYXRoPjwvc3ZnPg==);
}
@metinsaylan
metinsaylan / git-remote-add.sh
Created July 16, 2020 16:12
git remote add
git remote add origin https://github.com/<username>/<repo>.git
git branch --set-upstream-to=origin/master master
git push -f origin master
@metinsaylan
metinsaylan / meta-tags.md
Created April 30, 2019 12:54 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
$Compare = Compare-VM -Path 'F:\vms\Mirage\Virtual Machines\047e8a12-50e2-446c-b42f-b834655449da.xml'
$Compare.Incompatibilities | Select-Object Message | FL
@metinsaylan
metinsaylan / js-toc.css
Last active October 14, 2018 13:03
JS-TOC - Javascript Generated Table of Contents
/* JS-TOC */
.js-toc-w:hover {
opacity: 1;
width: 220px;
}
.js-toc-w {
position: fixed;
top: 280px;
padding: 10px 15px 10px 10px;
@metinsaylan
metinsaylan / rmblanks.py
Created February 24, 2018 00:13 — forked from anonymous/rmblanks.py
This Python script deletes all blank folders under a given path. Minimum python version: 3.5.
#-------------------------------------------------------------
# rmblanks.py
# Deletes all empty folders under a given path.
# http://metinsaylan.com
#-------------------------------------------------------------
# Usage: rmblanks.py "E:/Test"
import sys, os