html - Using nth-last-child() to hide last pages of will-paginate not working -


i wanted hide last pages of paginate instead of this:

prev | 1 2 .. 5 6 7 .. 30 31 | next

it this:

prev | 1 2 .. 5 6 7 .. | next

the html code generated will-paginate follows

<ul class="pagination pagination">    <li class="prev">      <a rel="prev" href="/videos?page=5">← previous</a>    </li>     <li>      <a rel="start" href="/videos?page=1">1</a>    </li>     <li>      <a href="/videos?page=2">2</a>    </li>     <li class="disabled">      <span>…</span>    </li>     <li>      <a rel="prev" href="/videos?page=5">5</a>    </li>     <li class="active">      <span>6</span>    </li>     <li>      <a rel="next" href="/videos?page=7">7</a>    </li> <li class="disabled">    <span>…</span>    </li>     <li>      <a href="/videos?page=30">30</a>    </li>     <li>      <a href="/videos?page=31">31</a>    </li>     <li class="next">      <a rel="next" href="/videos?page=7">next →</a>    </li>  </ul>

i trying hide last pages through following css:

.pagination_links li:nth-last-child(1) {  	display : none !important;  	text-decoration: none !important;  }    .pagination_links li:nth-last-child(2) {  	display : none !important;  	text-decoration: none !important;  }

i thought maybe had hide actual href div , not li tried too:

.pagination_links li:nth-last-child(1) {  	display : none !important;  	text-decoration: none !important;  }    .pagination_links li:nth-last-child(2) {  	display : none !important;  	text-decoration: none !important;  }

still nothing. ideas?

you have typo, change <ul class="pagination pagination"> <ul class="pagination pagination_links">

also if want like
<-pre 1 2 ...6 7 ...->next, need change css

.pagination_links li:nth-last-child(2) {       display : none !important;     text-decoration: none !important; }  .pagination_links li:nth-last-child(3) {     display : none !important;     text-decoration: none !important; } 

because .pagination_links li:nth-last-child(1) next->


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -