私は友人のビジネスで編集作業を行っていますが、wordpress テンプレートは非常に古風な方法で書かれています。ほとんどのコードがどのように機能するかを理解しましたが、ファイルがcss情報を参照していて、通常の方法でインポートされておらず、メインのワードプレスを使用していないことがわかりませんテーマ css ファイル。firebugでもリソースを見つけることができません。このコードがどのように機能するかを理解してくれる人はいますか? 私は特にsingleStyle divのcss情報にアクセスしようとしています
URL: http://wp.rafelshearling.com/?page_id=319
コード:
<?php
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
<?php the_ID(); ?>
post_class();
*/
?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-content">
<?php if(is_page( array( 319, 321 ) ) ) { ?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<?php if(is_page( 319 ) ) { // Mens ?>
<script>
var pageNum = 1;
var catIndex = 0;
var pageMax, catSlugList = ["jackets"];
var originalCat = catSlugList[catIndex];
var originalCatID = 9;
$(function() {
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
$(".childrenUls a").click( function(e){
return false;
});
$("#collectionNav p a").click( function(e){
if(this.getAttribute("href") === "#Back"){
if(pageNum === 1){
return false;
} else {
pageNum--;
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
}
} else if(this.getAttribute("href") === "#More"){
if(pageNum < pageMax){
pageNum++;
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
} else {
return false
}
}
return false;
});
});
</script>
<ul class="childrenUls cMe">
<?php wp_list_categories('child_of=5&orderby=id&order=DESC&title_li='); ?>
</ul>
<?php } else if(is_page( 321 ) ) { // Womens ?>
<script>
var pageNum = 1;
var catIndex = 0;
var pageMax, catSlugList = ["jackets-vests-assessories","hip-34-length","full-length"];
var originalCat = catSlugList[catIndex];
var originalCatID = 8;
$(function() {
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
$(".childrenUls a").click( function(e){
catIndex = $(".childrenUls a").index(this);
pageNum = 1;
$.ajax({
url: '/?json=get_category_posts&slug='+catSlugList[catIndex]+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
return false;
});
$("#collectionNav p a").click( function(e){
if(this.getAttribute("href") === "#Back"){
if(pageNum===1){
if(catIndex === 0){
return
} else {
pageNum = 1;
catIndex--;
originalCat = catSlugList[catIndex];
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
}
} else {
pageNum--;
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
}
} else if(this.getAttribute("href") === "#More"){
if(pageNum===pageMax){
if(catSlugList.length-1 === catIndex){
return
} else {
pageNum = 1;
catIndex++;
originalCat = catSlugList[catIndex];
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
}
} else if(pageNum < pageMax){
pageNum++;
$.ajax({
url: '/?json=get_category_posts&slug='+originalCat+'&count=12&page='+pageNum+'&exclude=categories,type,url,title_plain,status,excerpt,comments,comment_count,comment_status,tags,attachments,modified,date,author',
success: function(data) {
$("#stylesDiv, #viewLargerDiv").empty();
pageMax = data.pages;
var $collectionDiv = $("#styleCollectionDiv").children("div:eq(1)");
var $showLargerDiv = $("#viewLargerDiv");
for(var i in data.posts){
$collectionDiv.append("<div class='singleStyle'>"+data.posts[i].content+"<p>"+data.posts[i].title+"</p></div>");
}
$showLargerDiv.append($collectionDiv.children("div:eq(0)").clone());
$("#stylesDiv .singleStyle").mouseenter( function(e){
$("#viewLargerDiv").empty().append($(this).clone());
});
$(".childrenUls a").removeClass("active");
$(".childrenUls a:eq("+catIndex+")").addClass("active");
}
});
} else {
return false
}
}
return false;
});
});
</script>
<ul class="childrenUls">
<?php wp_list_categories('child_of=4&orderby=id&order=DESC&title_li='); ?>
</ul>
<?php } ?>
<br style="clear:both;" />
<div id="largeViewDiv">
<div><p>Place mouse over thumbnails to view larger.</p></div>
<div id="viewLargerDiv"></div>
</div>
<div id="styleCollectionDiv">
<div id="collectionNav"><p class="cMe"><a class="backButton" href="#Back">< Back</a><a class="moreButton" href="#More">More ></a></p></div>
<div id="stylesDiv"></div>
</div>
<br style="clear:both;" />
<?php } else { ?>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
<?php } ?>
</div><!-- .entry-content -->
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<br><br><br><span class="edit-link">', '</span>' ); ?>