nathan_dawson
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Help with "IF / ELSE"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.
Forum: Fixing WordPress
In reply to: Help with "IF / ELSE"previous_post_link()
andnext_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; } } ?>
Forum: Fixing WordPress
In reply to: Excluding Posts (again!)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
Forum: Fixing WordPress
In reply to: changing the footerI’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' );
Forum: Plugins
In reply to: Passing a parameter to a theme functionChange
if $numberofdays > 0 {
To
if ( $numberofdays > 0 ) {
Forum: Plugins
In reply to: [Yoast SEO] Remove current post title from breadcrumbsThis 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.phpChange 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 );