Oliver Farrell
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Excerpt LinkI noticed that you have two functions declared to remove the read more hash, maybe try deleting the second one.
It’s likely that there’s some conflict with another function.
Let me know whether removing the duplicate function works for you.
Forum: Themes and Templates
In reply to: Excerpt LinkBy default WordPress will add the ‘#more-‘ after your posts permalinks. It enables people to skip to the rest of the article if they have read the excerpt.
To remove that, you need to add the following to your functions.php
function removeReadMoreHash($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'removeReadMoreHash');That should do the trick.
Forum: Everything else WordPress
In reply to: Custom post structure vs sub-folderYou could create a category called ‘blog’ and then attach the category to all your blog posts. Then, from your permalinks settings change them to ‘/%category%/%postname%/’. That way only your blog posts will have the ‘blog’ slug before them.
Of course, this solution assumes you aren’t going to be using the categories functionality for anything else.
Forum: Themes and Templates
In reply to: wp_link_pages Next/Prev Links in Separate Divs?Not a problem, sorry it took me a while to understand the question aha 🙂
Forum: Themes and Templates
In reply to: wp_link_pages Next/Prev Links in Separate Divs?Ah! My apologies, should have read your question more thoroughly.
I’m not wholly familiar with the function but I believe it is possible to place them in their own divs based on the example in the codex (http://codex.wordpress.org/Template_Tags/wp_link_pages)
You could try something like this maybe?
<?php $args = array( 'before' => '<div class="page-link-next-prev">', 'after' => '</div>', 'link_before' => , 'link_after' => , 'next_or_number' => 'next', 'nextpagelink' => __('<div class="next">Continue Reading</div>'), 'previouspagelink' => __('<div class="prev">Go Back</div>'), 'pagelink' => '%', 'more_file' => , 'echo' => 1 ); ?> <?php wp_link_pages( $args ); ?>Forum: Themes and Templates
In reply to: Function to load on homepage only in function.phpAh! That would make sense 🙂 That could save me a lot of messing about.
Forum: Themes and Templates
In reply to: Function to load on homepage only in function.phpOops, that’ll teach me to post before refreshing. Bronson’s suggestion should work just fine.
Forum: Themes and Templates
In reply to: Function to load on homepage only in function.phpWhat Bronson suggested should work just fine (if the homepage/front page are the pages you want to disable the scripts).
If there is a specific page/s you wish to disable the scripts on, do the following.
if ( is_page('about') || is_page('hello-world') ) { function wpsc_deregister_scripts() { wp_deregister_script( 'wpsc-thickbox' ); wp_deregister_script( 'jquery-rating' ); wp_deregister_script( 'wp-e-commerce' ); wp_deregister_script( 'jQuery' ); wp_deregister_script( 'infieldlabel' ); wp_deregister_script( 'wp-e-commerce-ajax-legacy' ); wp_deregister_script( 'wp-e-commerce-dynamic' ); wp_deregister_script( 'livequery' ); wp_deregister_script( 'wp-e-commerce-legacy' ); wp_deregister_script( 'l10n' ); wp_deregister_script( 'wpsc-gold-cart' ); } add_action( 'wp_print_scripts', 'wpsc_deregister_scripts', 100 ); }Alternatively, if there is a top-level page and it’s sub pages you wish the disable the scripts one, try looking into the ‘is_tree()’ function.
Forum: Themes and Templates
In reply to: wp_link_pages Next/Prev Links in Separate Divs?I have a function in my functions.php for handling this. It’s a nice a clean way of doing it really.
Add this to your functions.php file:
function ShowPostsNav() { global $wp_query; return ($wp_query->max_num_pages > 1); }And then put this wherever you want the links to appear:
<?php if ($wp_query->max_num_pages > 1) : ?> <?php next_posts_link(__('<span class="older_posts">← Older posts</span>')); ?> <?php previous_posts_link(__('<span class="newer_posts">Newer posts →</span>')); ?> <?php endif; ?>Should work just fine for you 🙂