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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class look : MonoBehaviour | |
{ | |
float xRot; | |
float yRot; | |
// Start is called before the first frame update | |
void Start() |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class audioclip : MonoBehaviour | |
{ | |
public AudioClip audioClip1; | |
public AudioClip audioClip2; | |
public AudioClip audioClip3; | |
public AudioClip audioClip4; |
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
https://www.facebook.com/dialog/pagetab?app_id=(App IDの入力)&display=popup&next=(Secure Page Tab URLの入力) | |
を直打ちでアドレスバーに入力し、アクセスします。 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>あれこれ</title> | |
<meta name="keywords" content="あれこれ" /> | |
<meta name="description" content="あれこれ" /> | |
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script> | |
<script src="main.js"></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
function shortcode_random_posts( $param ) { | |
return random_posts($param[0] , $param[1]); //0:カテゴリーID(0はカテゴリ指定なし) 1:表示記事数 | |
} | |
add_shortcode('random_posts','shortcode_random_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
動作方法(ショートコードの書き方) | |
表示したい箇所(本記事のように投稿内)にショートコードを下記のように記載します。 | |
[random_posts カテゴリID 個数] | |
このように記載すると指定カテゴリIDの記事を指定個数分、リンク付きで、アイキャッチ画像とタイトルを表示します。 | |
※カテゴリID=0を指定するとすべての投稿を対象とします。 | |
プラグイン実装(ソースをほぼ加工なしで表示しています) | |
・class指定やCSS定義などは省略しています。 | |
ショートコード実装 |
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 if (have_posts()) : while (have_posts()) : the_post(); ?> | |
///////////////////////// | |
//テーマのfunctions.phpファイルに次のコードを配置します。 | |
function one_random_post_on_home_page( $query ) | |
{ | |
if ( ! ( $query->is_home() && $query->is_main_query() ) ) |
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 query_posts($query_string . "&orderby=rand"); ?> |
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
[random_posts limit=5] | |
<?php | |
function random_posts($attrs = array()){ | |
ob_start(); | |
$limit = !empty($attrs['limit']) ? $attrs['limit'] : 0; | |
?> | |
<?php | |
$args = array( | |
'post_type' => '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 query_posts(array('orderby' => 'rand', 'showposts' => 5)); | |
if (have_posts()) : | |
while (have_posts()) : the_post(); ?> | |
/* 繰り返し表示させる部分 */ | |
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> | |
<?php the_content(); ?> | |
<?php endwhile; endif; ?> |
NewerOlder