Skip to content

Instantly share code, notes, and snippets.

View fatihtoprak's full-sized avatar
🎯
Focusing

Fatih Toprak fatihtoprak

🎯
Focusing
View GitHub Profile
@luetkemj
luetkemj / wp-query-ref.php
Last active April 6, 2025 09:15
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@ismailbaskin
ismailbaskin / il_ilce_enlem_boylam.sql
Created April 25, 2012 18:50
Türkiye İl ve İlçelerin enlem boylam bilgileri
/*
Türkiye İl ve İlçelerin enlem boylam bilgileri (dörtgen olarak sınır pozisyonlarıyla birlikte) kaynak : google maps (başarsoft)
twitter : http://twitter.com/tserpico
*/
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
`lat` double(20,8) DEFAULT NULL COMMENT 'enlem',
@fatihtoprak
fatihtoprak / Poz_github2.php
Created October 24, 2012 20:07
wp#2 Popüler 5 yazarın yazılarını listelemek
<?php foreach ( get_users('order=DESC&orderby=post_count&number=5') as $user ) : ?>
<?php echo $user->display_name; ?> (<?php echo $user->post_count; ?> Posts)
<?php endforeach; ?>
@fatihtoprak
fatihtoprak / Poz_github7.php
Created October 25, 2012 06:21
wp#7 minimize cache for queries
<?php
# http://www.fatihtoprak.com
$Poz = new WP_Query(array(
'posts_per_page' => 2,
'orderby' => 'date',
'order' => 'DESC',
'no_found_rows' => true,
'update_post_term_cache' => false,
@fatihtoprak
fatihtoprak / Poz_github7.php
Created October 25, 2012 07:26
wp#7 cached queries
<?php
# Cached Wordpress queries
# http://www.fatihtoprak.com
# SE Disq : http://wordpress.stackexchange.com/questions/70424/posts-per-page-doesnt-work/70425
$Poz = array(
'posts_per_page' => 5,
'orderby' => 'date',
'order' => 'DESC',
@upekshawisidagama
upekshawisidagama / class-wp-replace-img-url.php
Last active October 4, 2017 13:40
WordPress Replace Image URL
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* WordPress Replace Image URL
*
* Replaces image url content of the WordPress post content.
*
* PHP version 5
* WordPress version 3.5
<?php
add_action('admin_notices', 'showAdminMessages');
function showAdminMessages()
{
$plugin_messages = array();
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
// Download the Yoast WordPress SEO plugin
if(!is_plugin_active( 'wordpress-seo/wp-seo.php' ))
{
$plugin_messages[] = 'This theme requires you to install the Yoast WordPress SEO plugin, <a href="http://wordpress.org/extend/plugins/wordpress-seo/">download it from here</a>.';
@fatihtoprak
fatihtoprak / Bakimda.html
Last active December 12, 2015 08:48
Wordpress Bakımda Sayfası oluşturmak / HTML Adım 1 : HTML şablonu oluşturmak Daha fazla detay için http://www.fatihtoprak.com/uye-girisi-yapmayan-kullanicilara-icerik-sayfasini-gostermemek-ipucu-125.html
<!DOCTYPE HTML>
<html>
<head>
<title>New Website coming soon!</title>
</head>
<body>
<h1>Bu web sitesi kısa süreliğine yeni versiyon çalışması nedeni ile yayınına ara vermiş bulunuyor. Lütfen yakın gelecekte yeniden ziyaret ediniz (:.</h1>
</body>
</html>
@phoenixg
phoenixg / header_http_status_codes.php
Created April 6, 2013 14:02
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(
@joshhartman
joshhartman / autoembed-example.php
Last active May 10, 2020 02:43
AutoEmbed PHP Class to parse a string for URLs on their own line and use oEmbed to embed remote content based on the URL
<!DOCTYPE html>
<html>
<head>
<title>AutoEmbed Examples</title>
</head>
<body>
<h1>AutoEmbed Examples</h1>
<?php
$content = "
<p>Have a laugh...</p>