동경디즈니렌드에서…
아침부터 저녁까지…
나이가 들었는지 하루 놀았는데 몇일이 지나 체력이 회복되더군요…^^
View Album
요즘 wordpress로 和服店 사이트를 만들어 봤습니다.
스킨을 만들었을 뿐이죠.
소스 수정은 /wp-includes/post-template.php
메인에서 추천상품 불러올때 글 자르기를 추가했습니다.
그리고 tinymce에디트 realTinyMCE is not defined. javascript에러 나서 검색해봤더니
$supportsGzip = false;
문제였습니다.
아마 서버 설정마다 모두 틀렸어 그렇나봅니다.
한국서버에서는 아무런 문제 없는데 일본xrea서버는 문제가 생겻습니다.
글 자르기 소스 수정보기
파일위치 : /wp-includes/post-template.php
function the_content($more_link_text = ‘(more…)’, $stripteaser = 0, $more_file = ”) {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
echo $content;
}
여기서 the_contenct함수를 복사해서 새로운 함수를(the_main_centecnt) 만들어 줌니다.
function the_main_content($more_link_text = ‘(more…)’, $stripteaser = 0, $more_file = ”) {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters(‘the_content’, $content);
$content = mb_substr(str_replace(‘]]>’, ‘]]>’, $content),0,250).”…..”;//문자열자르기0부터250자까지..
echo $content;
}
realTinyMCE is not defined 에러 해결
파일위치 : /wp-includes/js/tinymce/tiny_mce_gzip.php
파일에서 아래를 찾아봅니다.
if ((in_array(‘gzip’, $encodings) || in_array(‘x-gzip’, $encodings) || isset($_SERVER['---------------'])) && function_exists(‘ob_gzhandler’) && !ini_get(‘zlib.output_compression’) && ini_get(‘output_handler’) != ‘ob_gzhandler’) {
$enc = in_array(‘x-gzip’, $encodings) ? “x-gzip” : “gzip”;
$supportsGzip = true;
}
여기에서
$supportsGzip = true; 를 $supportsGzip = false; 로 고쳐줍니다.
메인에서 원하는 카테고리 뽑아오기
만약 카테고리 아이디가 3,6,7,8…..등일때 6만 뽑아 온다면
<?php query_posts($query_string . “&cat=6&showposts=2&order=DESC”); ?>
이렇게 해주면 6의 카테고리 포스트2개 DESC순서로 뽑아 옴.
메인에서 포스트 글자르기 함수 사용하기.
직접 합수그대로 사용. <?php the_main_content(__(‘(more…)’)); ?>
아래는 스크린샷.












Recent Comments