2014-11-08 54 views
1

只是要總結: 這是如何滑塊應該看起來像 - >http://luiszuno.com/themes/wp-dokedoke/work/porttitor/(原始演示) ,當我添加圖像從媒體到工作去內容,而不是像這樣的滑塊 - >http://netsurf.ir/work/project-2(網址是波斯語) 工作滑塊:(WordPress的)圖像工作的附件,但沒有出現在滑塊

<?php 
    /* 
    * 
    * Retrieve and displays all images 
    * 
    */ 

    $args = array( 
     'post_type' => 'attachment', 
     'numberposts' => -1, 
     'post_status' => null, 
     'post_parent' => $post->ID, 
     'post_mime_type' => 'image', 
     'order' => 'ASC' 
    ); 
    $attachments = get_posts($args); 
?> 

<div id="project-gallery"><!-- swipper --> 
<div class="gallery-container"> 
    <div class="swiper-container clearfix"> 
     <div class="swiper-wrapper clearfix"> 


     <!-- Images --> 
     <?php if ($attachments) : ?> 
      <?php 
       foreach ($attachments as $attachment) : 
        $this_image = aq_resize($attachment->guid, 672); 
      ?> 
       <div class="swiper-slide"> <img src="<?php echo $this_image ?>" alt="<?php echo $attachment->guid ?>"> </div> 

      <?php endforeach ?> 
     <?php endif ?> 
     <!-- ENDS images --> 


     </div> 

    </div> 
</div> 
<!-- ENDS swipper --> 

我的工作文字:

<a href="somewhere/03.jpg(cant post more than 2links)"><img class="alignnone size-full wp-image-41" src="http://netsurf.ir/wp-content/uploads/03.jpg" alt="03" width="672" height="400" /></a> <img class="alignnone size-full wp-image-42" src="somewhere/04.jpg" alt="04" width="672" height="400" /> 

回答

1

你能後的代碼對整個文件w在這裏你試圖添加這個滑塊?看起來你所擁有的代碼是正確的,但是你把這個代碼放在哪裏纔是最重要的。

1

原來的主題樣品其滑塊工作正常:http://luiszuno.com/themes/wp-dokedoke/work/porttitor/

<!-- work--> 
    <section class="page-section zigzag" > 
     <div class="page-section-inner"> 
     <h1 class="heading">Porttitor</h1> 
      <div class="subheading"><p>example paragraph [&hellip;]</p> 
</div> 
     </div> 


<div id="project-gallery"><!-- swipper --> 
<div class="gallery-container"> 
    <div class="swiper-container clearfix"> 
     <div class="swiper-wrapper clearfix"> 


     <!-- Images --> 
            <div class="swiper-slide"> <img src="somewhere/worke2.jpg" alt="somewhere/worke2.jpg"> </div> 

          <div class="swiper-slide"> <img src="somewhere/workf2.jpg" alt="work/workf2.jpg"> </div> 


     <!-- ENDS images --> 


     </div> 

    </div> 
</div> 
<!-- ENDS swipper --> 

,這裏是我的網站相同的一部分滑塊不工作:http://netsurf.ir/work/project-2

<!-- work--> 
    <section class="page-section zigzag" > 
     <div class="page-section-inner"> 
     <h1 class="heading">Project 2</h1> 
      <div class="subheading"></div> 
     </div> 


<div id="project-gallery"><!-- swipper --> 
<div class="gallery-container"> 
    <div class="swiper-container clearfix"> 
     <div class="swiper-wrapper clearfix"> 


     <!-- Images --> 

     <!-- ENDS images --> 


     </div> 

    </div> 
</div> 
<!-- ENDS swipper --> 

圖像部分是空的,但在WordPress的我通過「添加媒體」將圖像添加到作品中

1

好吧,所以我仍然沒有看到頁面上的所有代碼。我不知道你是多麼熟悉wordpress和這個滑塊這樣的東西,但這裏是我看到的:

你在這裏顯示的代碼看起來是正確的。唯一的辦法是,嘗試將活動滑塊div中的所有樣式複製到新滑塊中。

<div class="swiper-wrapper clearfix" style="width: 2688px; transform: translate3d(-1204px, 0px, 0px); -webkit-transform: translate3d(-1204px, 0px, 0px); transition: 0s; -webkit-transition: 0s; height: 400px;"><div class="swiper-slide" style="width: 672px; height: 400px;"> <img src="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/workf2.jpg" alt="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/workf2.jpg"> </div> 

    <!-- Images --> 

     <div class="swiper-slide swiper-slide-visible swiper-slide-active" style="width: 672px; height: 400px;"> <img src="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/worke2.jpg" alt="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/worke2.jpg"> </div> 

     <div class="swiper-slide" style="width: 672px; height: 400px;"> <img src="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/workf2.jpg" alt="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/workf2.jpg"> </div> 

    <!-- ENDS images --> 

    <div class="swiper-slide" style="width: 672px; height: 400px;"> <img src="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/worke2.jpg" alt="http://luiszuno.com/themes/wp-dokedoke/wp-content/uploads/2013/09/worke2.jpg"> </div></div> 
1
<!doctype html> 
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> 
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> 
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> 
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US" > <!--<![endif]--> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title>Project 2 | Mr. imager </title> 
    <meta name="viewport" content="width=device-width,initial-scale=1"> 

    <!-- CSS --> 
    <link rel="stylesheet" href="http://netsurf.ir/wp-content/themes/dokedoke/css/initializr.css"> 
    <link rel="stylesheet" href="http://netsurf.ir/wp-content/themes/dokedoke/css/style.css"> 
    <link rel="stylesheet" href="http://netsurf.ir/wp-content/themes/dokedoke/css/idangerous.swiper.css"> 


      <link rel="stylesheet" href="http://netsurf.ir/wp-content/themes/dokedoke/css/responsive.css"> 

    <!-- FONTS --> 
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,900' rel='stylesheet' type='text/css'> 
    <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400' rel='stylesheet' type='text/css'> 

    <script src="http://netsurf.ir/wp-content/themes/dokedoke/js/modernizr.min.js"></script> 

    <meta name='robots' content='noindex,follow' /> 
<link rel="alternate" type="application/rss+xml" title="Mr. imager &raquo; Feed" href="http://netsurf.ir/feed" /> 
<link rel="alternate" type="application/rss+xml" title="Mr. imager &raquo; Comments Feed" href="http://netsurf.ir/comments/feed" /> 
<link rel="alternate" type="application/rss+xml" title="Mr. imager &raquo; Project 2 Comments Feed" href="http://netsurf.ir/work/project-2/feed" /> 
<link rel='stylesheet' id='contact-form-7-css' href='http://netsurf.ir/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=4.0.1' type='text/css' media='all' /> 
<script type='text/javascript' src='http://netsurf.ir/wp-includes/js/jquery/jquery.js?ver=1.11.1'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> 
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://netsurf.ir/xmlrpc.php?rsd" /> 
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://netsurf.ir/wp-includes/wlwmanifest.xml" /> 
<link rel='prev' title='Project' href='http://netsurf.ir/work/project' /> 
<meta name="generator" content="WordPress 4.0" /> 
<link rel='canonical' href='http://netsurf.ir/work/project-2' /> 
<link rel='shortlink' href='http://netsurf.ir/?p=54' /> 
</head> 
<body class="single single-work postid-54 logged-in"> 

    <header> 
    <div class="navbar"> 
     <div class="menu-menu-1-container"><ul id="main-nav" class="sf-menu"><li id="menu-item-37" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-37"><a href="http://netsurf.ir/"><span>خانه</span></a></li> 
<li id="menu-item-53" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-53"><a href="http://netsurf.ir/work"><span>نمونه کار</span></a></li> 
<li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-13"><a href="http://netsurf.ir/%d8%b3%d9%81%d8%a7%d8%b1%d8%b4-%d8%b7%d8%b1%d8%a7%d8%ad%db%8c"><span>سفارش طراحی</span></a></li> 
<li id="menu-item-49" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-49"><a href="http://netsurf.ir/%d9%be%d8%b1%d8%af%d8%a7%d8%ae%d8%aa"><span>پرداخت</span></a></li> 
</ul></div> </div> 
</header> 


    <!-- main content --> 
    <div class="main"> 


     <div id="page-title" class="main-title"> 
     <img src="http://netsurf.ir/wp-content/themes/dokedoke/img/logo.png" alt="Mr. imager"class="main-logo" /> 



    </div> 



    <!-- work--> 
    <section class="page-section zigzag" > 
     <div class="page-section-inner"> 
     <h1 class="heading">Project 2</h1> 
      <div class="subheading"></div> 
     </div> 


<div id="project-gallery"><!-- swipper --> 
<div class="gallery-container"> 
    <div class="swiper-container clearfix"> 
     <div class="swiper-wrapper clearfix"> 


     <!-- Images --> 

     <!-- ENDS images --> 


     </div> 

    </div> 
</div> 
<!-- ENDS swipper --> 



     <div class="page-section-inner clearfix"> 

      <!-- project info --> 
      <div class="project-info"> 
                <p><strong>Date </strong><br/>مهرماه 93</p> 

      </div> 
      <!-- ENDS project info --> 

      <div class="project-content"><p><a href="http://netsurf.ir/%d8%ae%d8%a7%d9%86%d9%87/attachment/03" rel="attachment wp-att-41"><img class="alignnone size-full wp-image-41" src="http://netsurf.ir/wp-content/uploads/03.jpg" alt="03" width="672" height="400" /></a> <a href="http://netsurf.ir/%d8%ae%d8%a7%d9%86%d9%87/attachment/04" rel="attachment wp-att-42"><img class="alignnone size-full wp-image-42" src="http://netsurf.ir/wp-content/uploads/04.jpg" alt="04" width="672" height="400" /></a></p> 
</div> 



     </div> 

    </section> 
    <!-- ENDS work--> 







<!-- similar projects--> 
<section class="page-section-white" > 

    <div class="related-projects-holder"> 
     <div class="heading">Similar Projects</div> 
     <ul class="related-projects clearfix"> 


      <li> 


       <a href="http://netsurf.ir/work/project" class="thumb">  

<a href="http://netsurf.ir/work/project" class="thumb" > 
    <img src="http://netsurf.ir/wp-content/uploads/04.jpg" alt="Project" /> 
</a> 

</a> 


       <a href="http://netsurf.ir/work/project" class="heading">Project</a> 
      </li> 


     </ul> 
    </div> 
</section> 
<!-- ENDS similar projects--> 









<!-- social --> 
<section class="page-section" > 
    <!-- social icons --> 
    <div class="icons "> 
                                                                          </div> 
    <!-- ENDS social icons --> 
</section > 
<!-- ENDS social -->  <!-- WIDGETS --> 
<section class="page-section" > 
    <ul class="widget-cols clearfix"> 
     <li class="first-col"> 
      <div class="widget-block"><h4 class="heading">جستجو</h4><form role="search" method="get" id="searchform" class="searchform" action="http://netsurf.ir/"> 
       <div> 
        <label class="screen-reader-text" for="s">Search for:</label> 
        <input type="text" value="" name="s" id="s" /> 
        <input type="submit" id="searchsubmit" value="Search" /> 
       </div> 
      </form></div>  </li> 

     <li class="second-col"> 
      <div class="widget-block"><h4 class="heading">نماد تجارتی</h4>   <div class="textwidget">1393 © Mr. imager </div> 
     </div>  </li> 

     <li class="third-col"> 
      <div class="widget-block"><h4 class="heading">برچسب ها</h4><div class="tagcloud"></div> 
</div>  </li> 

    </ul> 
</section> 
<!-- ENDS WIDGETS -->  
     <!-- footer --> 
     <footer> 
      <div class="inner"> 
          </div> 
     </footer> 
     <!-- ENDSfooter --> 


    </div> 
    <!-- ENDS main content --> 





<script type='text/javascript' src='http://netsurf.ir/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.51.0-2014.06.20'></script> 
<script type='text/javascript'> 
/* <![CDATA[ */ 
var _wpcf7 = {"loaderUrl":"http:\/\/netsurf.ir\/wp-content\/plugins\/contact-form-7\/images\/ajax-loader.gif","sending":"Sending ..."}; 
/* ]]> */ 
</script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.0.1'></script> 
<script type='text/javascript'> 
/* <![CDATA[ */ 
var myJsVars = {"inner_background":"http:\/\/netsurf.ir\/wp-content\/themes\/dokedoke\/img\/dummies\/page-bg.jpg","front_background1":"http:\/\/netsurf.ir\/wp-content\/themes\/dokedoke\/img\/slides\/02.jpg","front_background2":"http:\/\/netsurf.ir\/wp-content\/themes\/dokedoke\/img\/slides\/02.jpg","front_background_duration":"4000"}; 
/* ]]> */ 
</script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//custom.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//superfish.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//backstretch.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//idangerous.swiper.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//jquery.mixitup.min.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-content/themes/dokedoke/js//jquery.cycle2.js?ver=4.0'></script> 
<script type='text/javascript' src='http://netsurf.ir/wp-includes/js/comment-reply.min.js?ver=4.0'></script> 

</body> 
</html> 

這應該是所有的項目頁面上, 當我添加圖片到WordPress的面板項目不言而喻的說明,所以我想我需要把圖像導入主題滑塊,但如何? 和我複製粘貼活到PHP中,它適用於所有的項目頁面,它的作品你