Joke Collection Website - Cold jokes - How to add the previous article and next article button form in wordpress
How to add the previous article and next article button form in wordpress
Put the following code into the while main loop of the single.php file of your theme: lt;nav?id="nav-single"gt;
lt; span?class="nav-previous"gt;lt;?php?previous_post_link(?$format='lt;span?class="left-arrow"gt;lt;/spangt;?link?',?$link= 'title',?$in_same_cat?=?false,?$excluded_categories?=?'');?gt;lt;/spangt;
lt;span?class="nav-next"gt; lt;?php?next_post_link($format='?link?lt;span?class="right-arrow"gt;lt;/spangt;',?$link='title',?$in_same_cat?=?false, ?$excluded_categories?=?'');?gt;lt;/spangt;
lt;/navgt;lt;!--?#nav-single?--gt;
For CSS, please refer to lines 1714-1723 in the style of the 2013 theme that comes with WP, plus: .left-arrow: before, .right-arrow: after{
width:?14px;
p>height: ?14px;
display: ?inline-block;
padding: ?8px?0;
color: ?#999 ;
font:?400?14px/1?dashicons!important;
font-weight:?normal;
font-style:?normal;
speak: ?none;
text-align: ?center;
vertical-align: ?middle;
-webkit-font -smoothing:?antialiased;
-moz-osx-font-smoothing:?grayscale;
-moz-transition:?all?.1s?ease-in-out;
-webkit-transition:?all?.1s?ease-in-out;
transition:?all?.1s?ease-in-out;
}
.left-arrow:before{
content:?"\f340";
}
.right-arrow :after{
content:?"\f344";
} You need to load the dashicons that come with WP in the theme frontend before the left and right arrows will appear, as shown below
Test screenshot:
- Related articles
- What does it mean for a man to tell jokes in a circle of friends every day?
- The old man always likes to be angry. He often scolds us for being unfilial, saying that we want to provoke him to death, and that we must do whatever he wants no matter what. It is unreasonable.
- Can anyone introduce me to the book Niu Meng?
- There are many overrated players in "Slam Dunk". Who is the biggest importer among them?
- Chinese composition requires twelve volumes.
- Those born in the 1980s talk about their partiality towards their parents-in-law.
- Bai Jie¡¯s character profile
- The most classic sentence to kill Matt is Martian.
- Message from kindergarten parents
- New version of joke sketch