2014-11-08 48 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中,它适用于所有的项目页面,它的作品你