Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Where are you attempting to place this code? Are you viewing an actual post (not a custom post type but a regular post)?

    I thought there could be an error in the code since I wrote it on the fly but I’ve tested it myself and it works perfectly so the issue will be down to implementation.

    previous_post_link() and next_post_link() output the link. You need to get the link first instead. Here’s how I’d go about it:

    <?php // Let's only attempt this on posts.
    if ( is_singular( 'post' ) ) {
        if ( $next_post_link = get_next_post_link( '<p>%link</p>' ) ) {
            echo '<h3>' . __( 'Next Article' ) . '</h3>';
            echo $next_post_link;
        }
    
        if ( $previous_post_link = get_previous_post_link( '<p>%link</p>' ) ) {
            echo '<h3>' . __( 'Previous Article' ) . '</h3>';
            echo $previous_post_link;
        }
    } ?>

    In the first set of code change
    <?php $query_posts = new WP_query('post_type=post&paged='.$paged);?>

    to
    <?php $query_posts = new WP_Query('post_type=post&cat=2paged=' . $paged); ?>

    Alternatively

    <?php $query_posts = new WP_Query( array(
      'post_type' => 'post',
      'paged'       => $paged,
      'cat'            => 2
    ) );

    Do the same for the second block of code but change ‘cat’ from 2 to -2

    I’ve downloaded the theme you’re using and taken a look.

    The code you’ve pasted has an action hook which is used to display the footer content.

    Add the following to your functions.php

    function tiffin_footer_content( $text ) {
        return 'Enter your footer text here...';
    }
    add_filter( 'expound_credits_text', 'tiffin_footer_content' );

    Change
    if $numberofdays > 0 {

    To
    if ( $numberofdays > 0 ) {

    This may be a bit late but I removed the title from posts with the following modifications. It doesn’t apply to pages but that can be achieved with some tweaks. Also further editing is necessary if you apply styling to the last breadcrumb such as making it bold.

    Edit this file:
    /plugins/wordpress-seo/frontend/class-breadcrumbs.php

    Change line 275:
    $output .= apply_filters( 'wpseo_breadcrumb_single_link', $link_output, $link );

    To:

    if ( $i < ( count( $links ) - 1 ) || ! is_single() )
    				$output .= apply_filters( 'wpseo_breadcrumb_single_link', $link_output, $link );

Viewing 6 replies - 1 through 6 (of 6 total)