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 sequential_posts_numberting( $post_type = 'post', $posts_per_page = -1, $post_status = 'publish' ) { | |
$posts_keys = array(); | |
$args = array( | |
'post_type' => $post_type, | |
'posts_per_page' => $posts_per_page, | |
'post_status' => $post_status, | |
); | |
$sequential_posts = get_posts( $args ); | |
if( ! empty( $sequential_posts ) ) { |
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
<? | |
/** | |
* add custom fields to search query :) | |
*/ | |
/** | |
* Extend WordPress search to include custom fields | |
* | |
* http://adambalee.com | |
*/ |
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 | |
$args = array( | |
'post_type' => 'news', | |
'posts_per_page' => -1, | |
); | |
$set_all_news_posts = get_posts( $args ); | |
foreach( $set_all_news_posts as $post ) { | |
setup_postdata( $post ); |
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 | |
$args = array( | |
'post_type' => 'works', | |
'posts_per_page' => -1, | |
); | |
$set_tax_posts = get_posts( $args ); | |
foreach( $set_tax_posts as $post ) { | |
setup_postdata( $post ); | |
$post_id = $post->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 | |
/** | |
* スライドショー投稿タイプ"スライドショー"を追加 | |
*/ | |
// Register Custom Post Type | |
function slider_type() { | |
$labels = array( | |
'name' => _x( 'スライドショー', 'Post Type General Name', 'textdomain' ), | |
'singular_name' => _x( 'スライドショー', 'Post Type Singular Name', 'textdomain' ), |
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 | |
wp_enqueue_style( | |
'cocoyoka_css', | |
get_stylesheet_directory_uri() . '/style.css', | |
array( 'parent_css' ), | |
date( 'TmdHis', filemtime( get_stylesheet_directory() . '/style.css' ) ), | |
'all' | |
); | |
wp_enqueue_script( |
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
require_once dirname( __FILE__ ) . '/vendor/autoload.php'; |
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
$ git pull origin master ← リモートリポジトリと同期 | |
$ git checkout -b DEV_BRANCH master ← 開発ブランチを作成 ///// masterだよ ///////// | |
--- ソースの修正 --- | |
$ git add -u | |
$ git commit -m "修正内容" | |
$ git push origin DEV_BRANCH ← リモートリポジトリの開発ブランチに push | |
$ git checkout master | |
$ git pull origin master ← 変更を取り込み(他の人が master に push してるかもなので ) | |
$ git merge DEV_BRANCH ← 開発ブランチをマージ | |
$ git push origin master |
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 disease_data_list() { | |
echo get_disease_data_list(); | |
} | |
function get_disease_data_list() { | |
global $post; | |
$current_user = wp_get_current_user(); | |
$display_name = esc_html( $current_user->display_name ); | |
if( isset( $_GET[ 'post_id' ] ) || isset( $_GET[ 'user_id' ] ) ) { | |
$post_id = intval( $_GET[ 'post_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 | |
$get_posts_arr = array(); | |
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => 'post', | |
'numberposts' => 10000, | |
'posts_per_page' => 100, | |
'paged' => $paged, | |
); | |
$another_way_retrieve_posts = get_posts( $args ); |