Plugin Directory

Changeset 3213568


Ignore:
Timestamp:
12/26/2024 11:07:38 PM (14 months ago)
Author:
laith3
Message:

Updated file with latest changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tradejournal/trunk/includes/template-functions.php

    r3196002 r3213568  
    8686            $content .= '<p>No trades found for this day.</p>';
    8787        }
     88
     89        // Add Previous and Next post navigation
     90        $prev_post = get_previous_post();
     91        $next_post = get_next_post();
     92
     93        $navigation = '<div class="tjwp-post-navigation">';
     94        if (!empty($prev_post)) {
     95            $navigation .= '<div class="nav-previous"><a href="' . get_permalink($prev_post->ID) . '">&laquo; Previous: ' . esc_html(get_the_title($prev_post->ID)) . '</a></div>';
     96        }
     97        if (!empty($next_post)) {
     98            $navigation .= '<div class="nav-next"><a href="' . get_permalink($next_post->ID) . '">Next: ' . esc_html(get_the_title($next_post->ID)) . ' &raquo;</a></div>';
     99        }
     100        $navigation .= '</div>';
     101
     102        $content .= $navigation;
    88103    }
    89104
Note: See TracChangeset for help on using the changeset viewer.