Forums › Forums › Search & Filter Pro › Open result links in same window
- This topic has 12 replies, 2 voices, and was last updated 6 years, 2 months ago by Anonymous.
-
Anonymous(Private) September 13, 2018 at 4:24 pm #188357
<?php /** * Starts Headway * * @package Headway * @author Clay Griffiths */ /* Prevent direct access to this file */ if ( !defined('WP_CONTENT_DIR') ) die('Please do not access this file directly.'); /* Make sure PHP 5.2 or newer is installed and WordPress 3.2 or newer is installed. */ require_once get_template_directory() . '/library/common/compatibility-checks.php'; /* Load Headway! */ require_once get_template_directory() . '/library/common/functions.php'; require_once get_template_directory() . '/library/common/application.php'; Headway::init(); // THIS LINKS THE THUMBNAIL TO THE POST PERMALINK add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html = '<a href="' . get_permalink( $post_id ) . '" target="_blank" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '" >' . $html . '</a>'; return $html; } //ADDING NEXT AND PREVIOUS LINKS, USE SHORT CODE [previous-next-post-links] IN LOOP BUDDY SHORTCODE// function my_previous_next_post() { // retrieve the value for next post link $next_string = "Next >>"; ob_start(); next_post_link("%link", $next_string,$in_same_cat="true"); $next_link = ob_get_clean(); // retrieve the value for previous post link $previous_string = "<< Previous"; ob_start(); previous_post_link("%link", $previous_string,$in_same_cat="true"); $previous_link = ob_get_clean(); // build output $return = PHP_EOL . '<div id="next-previous" class="navigation clearfix">' . PHP_EOL; // display previous link if any if ($previous_link) { $return .= '<div class="nav-previous alignleft">'. PHP_EOL; $return .= $previous_link. PHP_EOL; $return .= '</div>'. PHP_EOL; } // display next link if any if ($next_link) { $return .= '<div class="nav-next alignright">'. PHP_EOL; $return .= $next_link . PHP_EOL; $return .= '</div>'. PHP_EOL; } $return .= '</div>'; return $return; } add_shortcode('previous-next-post-links', 'my_previous_next_post'); //SORT AJAX QUERY FILTER ALPHABETICALLY// add_filter('ajax_wpqsf_query','title_sorting_fn','',2); function title_sorting_fn($args, $id){ $args['orderby'] = 'title'; $args['order'] = 'ASC'; return $args; }
-
AuthorPosts