Wordpress Archives - Page 2 of 2 - 7-Views
Create Shortcode for [NEXT] and [PREVIOUS] to be placed into specific posts for post navigation
Add this code to your theme functions.php file add_shortcode( ‘prev’, ‘prev_shortcode’ ); add_shortcode( ‘next’, ‘next_shortcode’ ); function next_shortcode($atts) { global $post; ob_start(); next_post_link( ‘<div class=”nav-next”>%link</div>’, ‘Next post link’ ); $result = ob_get_contents(); ob_end_clean(); return $result; } function prev_shortcode($atts) { global $post; ob_start(); previous_post_link( ‘<div class=”nav-previous”>%link</div>’, ‘Previous post link’ ); $result = ob_get_contents(); ob_end_clean(); return $result; […]
Show Admin bar in wordpress only if user is logged in
You can determine if the user is logged in then only the admin bar is shown. For example, the following lines will only display the admin bar for logged in users.
Create Custom Pagination Function in WordPress theme
Sometime you want your custom style to be implemented in wordpress pagination for this you want to have your own pagination func For that add this fun to your theme functions.php file After adding the function move to the page where you have the post loop and the code above the loop $paged = ( […]
Adding ‘active’ class to open Bootstrap accordion item
Several times we want to have our own custom class on open tab of our bootstrap acoordion so that you can apply your custom css to it. A basic jQuery solution to add an ‘active’ class to the accordion heading of the currently active accordion item.
Update WordPress Without Using FTP
In some cases, we are not able to update/upgrade our WordPress and plugins to a newer version without providing our FTP connection information. This is a common issue whereby the WordPress system can’t write to your ‘wp-content’ folder directly. To resolve this you need to follow certain steps 1) Give ‘wp-content’ 775 permissions 2) Open […]