WordPress 사이트를 모방하는 방법

풀어 주다: 2019-07-13 09:00:39
원래의
13385명이 탐색했습니다.

WordPress 사이트를 모방하는 방법

WordPress 모방 사이트:

1. 대상 웹사이트를 캡처하려면 모방 사이트 가젯 8.0.2가 매우 유용하며 전체 웹사이트를 최대한 많이 캡처할 수 있습니다.

WordPress 사이트를 모방하는 방법

파일을 wp-content/tust에 저장하세요. 저장된 홈페이지 default.html 및 기타 파일 디렉터리는 다음과 같습니다.

WordPress 사이트를 모방하는 방법

그런 다음 표준 wp 파일을 만듭니다. 아래 그림과 같이

WordPress 사이트를 모방하는 방법

default.html을 header.php, index.php, footer.php

header.php로 분할하면 본문 내부에 탐색 표시줄이 포함됩니다.

index.php에는 주요 부분이 포함되어 있으며 header.php 및 footer.php를 참조해야 합니다.

footer.php에는 최종 저작권 및 기타 정보가 포함되어 있습니다.

2. header.php의 링크를 수정하여 홈페이지를 정상적으로 만드세요. 자주 사용하는 템플릿 기능:

기본 조건 판단 기능:

is_home(): 홈페이지 여부

is_single(): 콘텐츠 페이지 여부(게시물)

is_page(): 콘텐츠 페이지 여부 (페이지)

is_category(): 카테고리/아카이브 페이지인지 여부

is_tag(): 태그(태그) ​​아카이브 페이지인지 여부

is_date(): 지정된 날짜의 아카이브 페이지인지

is_year(): 특정 연도의 아카이브 페이지인지 여부

is_month(): 특정 월의 아카이브 페이지인지 여부

is_day(): 특정 날짜의 아카이브 페이지인지 여부

is_time (): 지정된 시간의 보관 페이지인지 여부

is_archive(): 보관 페이지인지 여부

is_search(): 검색결과 페이지인지 여부

is_404(): "HTTP"인지 여부 404: Not Found" 오류 페이지

is_paged(): 홈페이지/카테고리/아카이브 페이지가 여러 페이지에 표시되는지 여부

일반적으로 사용되는 PHP 함수의 헤더 부분:

: 블로그 이름(제목)

: CSS 파일 경로

: PingBack URL

; : 템플릿 파일 경로

: WordPress 버전

:Atom URL

:RSS 2.o URL

: 블로그 URL

< ;?php bloginfo('html_type'); ?>: 블로그 페이지 HTML 유형

: 블로그 페이지 인코딩

: 블로그 설명

: 특정 콘텐츠 페이지 제목(글/페이지)

템플릿에 일반적으로 사용되는 PHP 함수 및 명령:

: 헤더 템플릿 호출

: 사이드바 템플릿 호출

?php the_content() ?> : 콘텐츠 표시(글/페이지)

: 글/페이지 존재 여부 확인

:게시물/페이지가 존재하는 경우 표시됩니다

:종료되는 동안

: 종료되는 경우

: 표시 시간, 시간 형식은 "문자열" 매개변수에 의해 결정됩니다. 자세한 내용은 PHP 매뉴얼을 참조하세요

;: 본문 내 댓글 링크, comments_popup_script();를 사용하면 링크가 새 창에서 열립니다

: 콘텐츠 페이지(글/페이지) 제목

< ;?php the_permalink( ) ?>: 콘텐츠 페이지(글/페이지) URL

: 특정 콘텐츠 페이지(글/페이지)가 Category

: 작성자

: 특정 콘텐츠 페이지(글/페이지) ID

: 로그인되어 있고 권한이 있는 경우 링크 수정 표시

: 메시지/답장 템플릿 호출

: 페이지 목록 표시

: 카테고리 목록 표시

< ;?php Previous_post_link('%link') ?>: 이전 글 링크

: Calendar

: 콘텐츠 아카이브 표시

: 탐색, 이전/다음 기사 링크 표시

템플릿과 관련된 기타 기능:

: 해당 정보 출력

: 등록 표시; link

: 로그인/로그아웃 링크 표시

: 현재 콘텐츠 페이지 매기기

홈페이지/디렉토리 페이지에 모든 콘텐츠를 표시하지 않도록 콘텐츠

: 웹 페이지 로딩 시간(초)

템플릿의 CSS, js, 이미지 링크를 위의 기능으로 교체하세요

3. 페이지가 정상적으로 표시되면 네비게이션 바를 수정하세요.

네비게이션 바 설정 시 원본 코드 수정:

WordPress 사이트를 모방하는 방법

대신 wp_nav_menu를 사용하세요. 메뉴 네비게이션 코드는 아래 주석 부분과 같고, 모든 메뉴에 주석이 달려있습니다. 대체 시 아래 매개변수를 따르십시오.

<?php wp_nav_menu(  
array(  
&#39;theme_location&#39;  => &#39;&#39; //指定显示的导航名,如果没有设置,则显示第一个  
&#39;menu&#39;            => &#39;header-menu&#39;,  
&#39;container&#39;       => &#39;nav&#39;, //最外层容器标签名  
&#39;container_class&#39; => &#39;primary&#39;, //最外层容器class名  
&#39;container_id&#39;    => &#39;&#39;,//最外层容器id值  
&#39;menu_class&#39;      => &#39;sf-menu&#39;, //ul标签class  
&#39;menu_id&#39;         => &#39;topnav&#39;,//ul标签id  
&#39;echo&#39;            => true,//是否打印,默认是true,如果想将导航的代码作为赋值使用,可设置为false  
&#39;fallback_cb&#39;     => &#39;wp_page_menu&#39;,//备用的导航菜单函数,用于没有在后台设置导航时调用  
&#39;before&#39;          => &#39;&#39;,//显示在导航a标签之前  
&#39;after&#39;           => &#39;&#39;,//显示在导航a标签之后  
&#39;link_before&#39;     => &#39;&#39;,//显示在导航链接名之后  
&#39;link_after&#39;      => &#39;&#39;,//显示在导航链接名之前  
&#39;items_wrap&#39;      => &#39;<ul id="%1$s">%3$s</ul>&#39;,  
&#39;depth&#39;           => 0,////显示的菜单层数,默认0,0是显示所有层  
&#39;walker&#39;          => &#39;&#39;// //调用一个对象定义显示导航菜单 ));   
?>
로그인 후 복사

홈페이지의 header.php 수정이 완료되면 대략 다음과 같습니다.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo(&#39;charset&#39;); ?>" />
	<title>天津科技大学海洋与环境学院</title>
	<meta name="keywords" content="天津科技大学海洋与环境学院" />
	<meta name="description" content="<?php bloginfo(&#39;description&#39;); ?>" />
	<link rel="shortcut icon" type="image/ico" href="<?php echo get_option(&#39; wpd_logo &#39;); ?>" />
<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/reset-min.css" rel="stylesheet" type="text/css" />
<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/fonts-min.css" rel="stylesheet" type="text/css" />
<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/grids-min.css" rel="stylesheet" type="text/css" />
<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/common.css" rel="stylesheet" type="text/css" />
<script src="<?php bloginfo(&#39;template_url&#39;); ?>/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<!--[if lt IE 7]>
<script src="js/ie7.js"></script>
<![endif]-->
<script type="text/javascript" src="js/iepngfix_tilebg.js"></script>
<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/index.css" rel="stylesheet" type="text/css" />
	<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/frame-top-link.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo(&#39;template_url&#39;); ?>/css/mainmenu.css" />
	<link href="<?php bloginfo(&#39;template_url&#39;); ?>/css/jqueryslidemenu.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo(&#39;template_url&#39;); ?>/css/bigpic.css" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo(&#39;template_url&#39;); ?>/css/modulelist.css" />
	<link rel="stylesheet" type="text/css" href="<?php bloginfo(&#39;template_url&#39;); ?>/css/pager.css" />
	<script src="<?php bloginfo(&#39;template_url&#39;); ?>/js/jquery.slidemenu.js" type="text/javascript"></script>
	<script type="text/javascript" src="<?php bloginfo(&#39;template_url&#39;); ?>/js/xmosaic.js"></script>
	<script src="<?php bloginfo(&#39;template_url&#39;); ?>/js/jquery.js" type="text/javascript"></script>
	<script src="<?php bloginfo(&#39;template_url&#39;); ?>/js/kandytabs.pack.js" type="text/javascript"></script>
	<script src="<?php bloginfo(&#39;template_url&#39;); ?>/js/custom.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="<?php bloginfo(&#39;template_url&#39;); ?>/css/footer.css" />
<style>
.tag_description
{
    float: left;
    margin-top:7px;
      padding-bottom:5px;
	  list-style:none;
}
 
    .tag_description a
    {
 
        font-size: 12px;
        text-indent: 24px;
    }
 
    .tag_description p
    {
	font-family:"宋体",Verdana, Lucida, Arial, Helvetica;
		color: #666666;
		float:right;
		width:220px;
		line-height:24px;
        font-size: 12px;
        text-indent: 24px;
        text-align:justify; 
		margin-top:0px;
        text-justify:inter-ideograph;
 
    }
				    #AcadeInfoList
				    {
				        position:relative;
				        top:-20px;
				    }
				    #AcadeInfo_spliter
				    {
				         position:relative;
				        top:10px;
				    }
				    
				    #AcadeInfoList:nth-of-type(n)
				    {
				        position:relative;
				        top:0px;
				    }
				    #AcadeInfo_spliter:nth-of-type(n)
				    {
				         position:relative;
				        top:30px;
				    }
.tag_title{
	line-height:24px;
            background-position-x: 0%;
            background-position-y: -540px;
            background-repeat: no-repeat;
	    overflow-x: hidden;
	width:370px;
}
.tag_title a{color: #666666; font-size:12px; margin-left:0px; padding-left:5px; }
 
</style>
</head>
<body>
<div id="frame-top">
	<div id="frame-top-warpper">
		<div class="frame-top-link">
		
	<ul>
		<li class="first"><a target="" href="/">学院首页</a></li><li class=""><a target="" href="/7db3dc.html">联系我们</a></li><li class=""><a target="_blank" href="/admin.html">管理员入口</a></li>	</ul>
</div>
<div id="frame-top-logo">
	<table>
		<tr>
			<td  style="vertical-align:top">
				<a href="/" title="天津科技大学海洋与环境学院">
					<img  src="<?php bloginfo(&#39;template_url&#39;); ? alt="WordPress 사이트를 모방하는 방법" >/picture/2015-09-16-19-7642419411.png" />
				</a>
			</td>
		</tr>
	</table>
</div>
<div id="frame-top-navbar">
	<script type="text/javascript">
	    $(document).ready(function () {
	        mlddminit(375);
	    });
	</script>
	
	
		<div id="navbar-left"></div>
		<?php wp_nav_menu( array( &#39;container&#39; => &#39;div&#39;,&#39;container_id&#39; => &#39;navbar-middle&#39;,&#39;menu_class&#39; => &#39;mlddm&#39;) ); ?>
	
		<!--<ul class="mlddm" params="1,-1,500,slide,200,h">
			<li class="">
	<a href="#" target="">学院概况</a>
	<ul>
		<li><a href=&#39;/01589e.html&#39; target="">学院简介</a>
		        </li><li><a href=&#39;/cbc95b.html&#39; target="">历史沿革</a>
		        </li><li><a href=&#39;/1ab539.html&#39; target="">学院领导</a>
		        </li><li><a href=&#39;/ad9daf.html&#39; target="">学院党委</a>
		        </li><li><a href=&#39;/0c2b70.html&#39; target="">职能部门</a>
		        </li><li><a href=&#39;#&#39; target="">学术机构</a>
	
		  </li>    替换这里第一条的东西。	
	-->
	
	<div id="navbar-right"></div>
</div>
<?php wp_head(); ?>
로그인 후 복사

4. index.php의

을 수정합니다. 먼저 캐러셀 이미지를 수정합니다. 이미지는 다음과 같습니다:

<?php get_header(); ?>
<div id="frame-top-slider-detail"> </div>
		<div id="frame-top-slider" class="smallslider">
			<!-- 大图轮播-->
			<script type="text/javascript">
		        $(document).ready(function () {
					var l=$(&#39;#bigpic&#39;).children().length;
					var str=&#39;&#39;;
					for(var i=0; i < l;i++)
					{
						if(i==0)
							str += &#39;<li  class="on" ></li>&#39;;
						else
							str += &#39;<li class=" "></li>&#39;;
					}
					$(&#39;#pager&#39;).html(str);
		            var mosaic = XMosaic(&#39;bigpic&#39;, { pager: &#39;pager&#39;, delay: 10000, countX: 10, countY: 5, how: 9, order: 0 });
		        });
		    </script>
			<div  id ="bigpic">
			<a style="left: 0px; top: 0px; position: absolute;" target="_blank" href="/13v0to-1.html">
	<img  src=&#39;<?php echo get_option(&#39; wpd_banner1 &#39;); ? alt="WordPress 사이트를 모방하는 방법" >&#39; alt=&#39;1&#39; />
</a><a style="left: 0px; top: 0px; position: absolute;" target="_blank" href="">
	<img  src=&#39;<?php echo get_option(&#39; wpd_banner2 &#39;); ? alt="WordPress 사이트를 모방하는 방법" >&#39; alt=&#39;2&#39; />
</a>			</div>
		</div>
	</div>
로그인 후 복사

그런 다음 기사의 목록 부분을 수정합니다:

	<div id="frame-top-slider-mask">
		<ul class="ctrls" id="pager">
		</ul>
	</div>
</div>
<div id="frame-main-body">
	<div id="frame-main-wrapper" class="yui3-g">
		<div id="frame-main" class="yui3-u">
			<div id="frame-main-left" class="yui3-u-1-2">
				<div class="module module_left">
					<div class="module-name">
					<a href="/75d14e-1.html" target="_blank">学院新闻</a>
					<a style="font-size:13px; margin-left:250px; color:blue;" target="_blank" href="/75d14e-1.html">更多</a>
					</div>
					<div class="module-spliter">
						<div> </div>
					</div>
					<div class="module-warpper">
						<div>
	<div class="row pd5 fb">
		<a target="_blank" title="海洋与环境学院孙军院长一行走访国家海洋信息中心" href="/lqpmfv.html">海洋与环境学院孙军院长一行走访国家海洋信息中心</a>
	</div>
	<li class="row spic tag_description">
		<a target="_blank" href="/lqpmfv.html" title="海洋与环境学院孙军院长一行走访国家海洋信息中心">
			<img width=360    style="max-width:90%" align="left" alt="海洋与环境学院孙军院长一行走访国家海洋信息中心" src="<?php bloginfo(&#39;template_url&#39;); ?>/picture/540_225.jpg">
					</a>
	</li>
	<div style="clear:both;"></div>
</div>						<table cellspacing="0" cellpadding="0" class="tag_table">
	<tbody>
		
        <?php
			query_posts(
				//&#39;query_type = post&posts_per_page=8&#39;
				array ( &#39;category_name&#39; => &#39;business&#39;, &#39;posts_per_page&#39; => 8 )
				);
				$i=0; while(have_posts()) : the_post(); $i++; ?>
				<tr>
				<td width="100%">
					<ul>
						<li class="tag_title">
							<a target="_blank" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
						</li>
					</ul>
				</td>
				</tr>				
			<?php endwhile; wp_reset_query(); ?>	
		
		</tbody>
</table>					</div>
				</div>
			</div>
			<div id="frame-main-right" class="yui3-u-1-2">
				<div class="module">
					<div class="module-name"> <a href="/c6c7e7-1.html" target="_blank">通知公告</a>
					<a style="font-size:13px; margin-left:250px; color:blue;" target="_blank" href="/c6c7e7-1.html">更多</a>
					</div>
					<div class="module-spliter">
						<div> </div>
					</div>
					<div class="module-warpper">
			<table cellspacing="0" cellpadding="0" class="tag_table">
	<tbody>
		
        <?php
		query_posts(
			//&#39;query_type = post&posts_per_page=8&#39;
			array ( &#39;category_name&#39; => &#39;technolo&#39;, &#39;posts_per_page&#39; => 8 )
			);
			$i=0; while(have_posts()) : the_post(); $i++; ?>			
				<tr>
					<td width="100%">
						<ul>
							<li class="tag_title">
								<a target="_blank" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_time(&#39;Y年n月j日&#39;); ?>  <?php the_title(); ?></a>
							</li>
						</ul>
					</td>
				</tr>
		<?php endwhile; wp_reset_query(); ?>	
		
		</tbody>
</table>					</div>
				</div>
			</div>
		</div>
		<div id="frame-side" class="yui3-u">
			<div id="placehoder"></div>
			<ul>
				<li><a target="" href="/906368.html">研究成果</a></li><li><a target="" href="/faef50-1.html">学术交流</a></li><li><a target="_blank" href="http://hyxy.tust.edu.cn/shiyanshifan/1shoye.html">实践教学</a></li><li><a target="" href="/ccac59.html">教学成果</a></li><li><a target="" href="/4d3baa-1.html">学生资助</a></li><li><a target="" href="/801d37-1.html">校友相聚</a></li><li><a target="" href="#">学术报告</a></li>			</ul>
		</div>
	</div>
	<div id="frame-main-link" class="yui3-g">
		<div>
			<div id="demo" style="overflow:hidden;height:110px;margin:0 auto;">
				<table align="left" cellpadding="0" cellspace="0" border="0">
					<tr>
						<td id="demo1" valign="top">
						<div>
						<a style="width:0px;" href="/0c8a9f.html#ppzy" target="_blank"><img  src="<?php bloginfo(&#39;template_url&#39;); ? alt="WordPress 사이트를 모방하는 방법" >/picture/57243dbb36ec49fe8ea8839a947fe310.jpg" /></a><img  src="<?php bloginfo(&#39;template_url&#39;); ? alt="WordPress 사이트를 모방하는 방법" >/picture/869b86dfeae34a31b851fb01cec2b074.jpg" /><a   style="max-width:90%" href="http://hyhjbhjs.cl1.soochong.com" target="_blank"><img  src="<?php bloginfo(&#39;template_url&#39;); ? alt="WordPress 사이트를 모방하는 방법" >/picture/2015-08-27-20-0606158108.jpg" /></a><img  src="<?php bloginfo(&#39;template_url&#39;); ? alt="WordPress 사이트를 모방하는 방법" >/picture/39bfa2a5c9be4d87bb8c50a886d3f3c0.jpg" /></div>
						</td>
						<td id="demo2" valign="top"> </td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<?php get_footer(); ?>
로그인 후 복사

더 많은 WordPress 관련 기술 기사를 보려면 wordpress tutorial 열을 방문하여 알아보세요!

위 내용은 WordPress 사이트를 모방하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!