This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_template_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_template_directory().'/style.css'); ?>" /> | |
<?php if (is_child_theme()): ?> | |
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_directory_uri(); ?>/style.css?ver=<?php echo filemtime(get_stylesheet_directory().'/style.css') ?>" /> | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.com *.example.com; | |
root /var/www/vhosts/example.com; | |
index index.html index.htm; | |
charset utf-8; | |
access_log /var/log/nginx/example.com.access.log main; | |
error_log /var/log/nginx/example.com.error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen unix:/var/run/nginx-backend.sock; | |
server_name example.com *.example.com; | |
root /var/www/vhosts/example.com; | |
index index.php index.html index.htm; | |
access_log /var/log/nginx/example.com.backend.access.log backend; | |
keepalive_timeout 25; | |
port_in_redirect off; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
new disable_attachment_page(); | |
class disable_attachment_page { | |
function __construct() | |
{ | |
add_action("template_redirect", array(&$this, "template_redirect")); | |
add_action("admin_print_styles", array(&$this, "admin_print_styles")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function thumbnail_noimage($html, $post_id, $post_thumbnail_id, $size, $attr) { | |
if (!empty($html)) | |
return $html; | |
$post_thumbnail_id = 1234; // default thumbnail image id | |
$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); | |
return $html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- カテゴリー 4 の投稿を、カスタム投稿タイプ photo に | |
update wp_posts | |
set post_type = 'photo' | |
where post_type = 'post' | |
and exists | |
(select object_id | |
from wp_term_taxonomy as t | |
inner join wp_relationships as r on t.term_taxonomy_id = r.term_taxonomy_id | |
where t.term_id = 4 | |
and r.object_id = wp_posts.ID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function attachment_link_convert($content){ | |
global $wpdb; | |
$upload_dir = wp_upload_dir(); | |
$pattern = '#(<a [^>]*href=[\'"])('.preg_quote($upload_dir['baseurl']).'/)([^\'"]*)([\'"][^>]*><img [^>]*></a>)#uism'; | |
if ( preg_match_all($pattern, $content, $matches, PREG_SET_ORDER) ) { | |
foreach ( $matches as $match ) { | |
$attachment_id = $wpdb->get_var($wpdb->prepare(" | |
select p.ID | |
from {$wpdb->posts} as p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_footer', 'pm_trace_included_files' ); | |
function pm_trace_included_files() { | |
$includeds = array_values( | |
str_replace( | |
get_theme_root() | |
, "" | |
, array_filter( | |
get_included_files() | |
, create_function( '$f', 'return 0 === strpos( $f, get_theme_root() );' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The Grid ---------------------- */ | |
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row.large-collapse .column, | |
.lt-ie9 .row.large-collapse .columns { padding: 0; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row .row.large-collapse { margin: 0; } | |
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# パッケージ名 | |
PACKAGE = wp-total-hacks | |
# パッケージのタイプ。plugin または theme | |
PROJECT = plugin | |
# 本家 (url) より入手してインストールしておいたもの | |
MAKEPOT = $(HOME)/wordpress-i18n-tools/makepot.php | |
PHP = /usr/bin/php | |
MSGMERGE = /usr/bin/msgmerge |
OlderNewer