Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hitch - CP

Members
  • Joined

  • Last visited

  1. Hi Teodora! Thanks for the help. I've changed the code in functions.php and template.file to what you provided. You can see the current status here http://silverfernfitness.co.uk/articles/fitness-myths One strange thing to note ..with your code for the functions.php file (and interestingly with every other pagination snippet I've added) there seems to always be an error unless I add another '}' to the end of the code on the page. My current functions.php file is as follows: <?php /** * Starkers functions and definitions * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage Starkers * @since Starkers 4.0 */ /* ======================================================================================================================== Required external files ======================================================================================================================== */ require_once( 'external/starkers-utilities.php' ); /* ======================================================================================================================== Theme specific settings Uncomment register_nav_menus to enable a single menu with the title of "Primary Navigation" in your theme ======================================================================================================================== */ add_theme_support('post-thumbnails'); // register_nav_menus(array('primary' => 'Primary Navigation')); /* ======================================================================================================================== Actions and Filters ======================================================================================================================== */ add_action( 'wp_enqueue_scripts', 'script_enqueuer' ); add_filter( 'body_class', 'add_slug_to_body_class' ); /* ======================================================================================================================== Custom Post Types - include custom post types and taxonimies here e.g. e.g. require_once( 'custom-post-types/your-custom-post-type.php' ); ======================================================================================================================== */ /* ======================================================================================================================== Scripts ======================================================================================================================== */ /** * Add scripts via wp_head() * * @return void * @author Keir Whitaker */ function script_enqueuer() { wp_register_script( 'site', get_template_directory_uri().'/js/site.js', array( 'jquery' ) ); wp_enqueue_script( 'site' ); wp_register_style( 'screen', get_template_directory_uri().'/style.css', '', '', 'screen' ); wp_enqueue_style( 'screen' ); } /* ======================================================================================================================== Comments ======================================================================================================================== */ /** * Custom callback for outputting comments * * @return void * @author Keir Whitaker */ function starkers_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; ?> <?php if ( $comment->comment_approved == '1' ): ?> <li> <article id="comment-<?php comment_ID() ?>"> <?php echo get_avatar( $comment ); ?> <h4><?php comment_author_link() ?></h4> <time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time> <?php comment_text() ?> </article> <?php endif; ?> </li> /* ======================================================================================================================== Excerpt ======================================================================================================================== */ // Changing excerpt length <?php function new_excerpt_length($length) { return 30; } add_filter('excerpt_length', 'new_excerpt_length'); ?> /* ======================================================================================================================== Post Breadcrumbs ======================================================================================================================== */ <?php function the_breadcrumb() { if (!is_home()) { if (is_category() || is_single()) { the_category(' | '); } } } /* ======================================================================================================================== Pagination ======================================================================================================================== */ // Custom pagination (place in functions.php) function kriesi_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class='pagination'>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>«</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>›</a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>»</a>"; echo "</div>\n"; } }} Still very confused Thanks, Ali
  2. Hey Guys, It feels as though I am completely out of my depth here as I just simply cannot get the stupid WP pagination to work on my custom theme. I've been trying several different ways, as shown by tutorials but none have worked. I'm incredibly close to throwing my computer in the bin is has me that beat! If anybody is able to help me figure this out I'll be the happiest bloke in the world. functions.php /* ======================================================================================================================== Pagination ======================================================================================================================== */ function paginate() { global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; $pagination = array( 'base' => @add_query_arg('page','%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => true, 'type' => 'list', 'next_text' => '»', 'prev_text' => '«' ); if( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingsla****( trailingsla****( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ); if( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) ); echo paginate_links( $pagination ); }} page.php <?php /*Template Name: Fitness Myth Articles*/ ?> <?php get_header(); ?> <section class="body"> <section class="article-main-body"> <p><span>OUR LATEST ARTICLES</span></p> <h1 class="ie-bold">FITNESS MYTHS</h1> <div class="article-box"> <ul> <?php $recent = new WP_Query(); $recent->query('cat=8&showposts=5'); if($recent->have_posts()) : while($recent->have_posts()): $recent->the_post(); ?> <li> <div class="article-main-header"><a href="<?php the_permalink()?>"><h3><?php the_title()?></h3></a><span><?php the_time('F j, Y'); ?></span></div> <?php the_excerpt()?> <p><a class="read-full" href="<?php the_permalink()?>">Read Full Article</a></p> </li> <?php endwhile ?> <?php else : ?> <?php endif ?> </ul> </div> <div class="pagination"> <?php paginate(); ?> </div> </section> <aside class="article-aside"> <h4>Article Topics</h4> <a class="topics" href="/articles/motivation"><h6>Motivation</h6></a> <p>Ways to keep your motivation at its highest for those killer workouts!</p> <a class="topics" href="/articles/weight-loss"><h6>Weight Loss</h6></a> <p>Information for those who want to lose that extra weight</p> <a class="topics" href="/articles/muscle-gain"><h6>Muscle Gain</h6></a> <p>Articles for those wanting to gain a few more kilograms</p> <a class="topics" href="/articles/healthy-eating"><h6>Healthy Eating</h6></a> <p>Correct nutrition is the key to achieving any weight goals</p> <a class="topics" href="/articles/fitness-myths"><h6>Fitness Myths</h6></a> <p>Here we debunk those ever popular fitness myths</p> <a class="topics" href="/articles/all-articles"><h6>All Articles</h6></a> <p>Here you can see all of our articles in one place. Take your pick!</p> </aside> <div class="clear"></div> </section><!-- end section.body --> <?php get_footer(); ?> css /* ---------------------------------------------------------------------------------------------------------- 06 Pagination ---------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------- */ ul.page-numbers { margin: 20px 0 10px; width: 100%; padding: 0; font-size: 12px; line-height: normal; clear: both; float: left; } ul.page-numbers li { float: left; } ul.page-numbers a, ul.page-numbers span { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; background: -webkit-gradient(linear, left top, left bottom, from(#E4E3E3), to(#FFFFFF)); background: -moz-linear-gradient(top, #E4E3E3, #FFFFFF); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#E4E3E3', endColorstr='#FFFFFF'); padding: 3px 4px 2px 4px; margin: 2px; text-decoration: none; border: 1px solid #ccc; color: #666; } ul.page-numbers a:hover, ul.page-numbers span.current { border: 1px solid #666; color: #444; }
  3. Hi Guys, Site/page in question is: http://silverfernfit....co.uk/articles Here is a link to an image of the design that I am trying to create: www.silverfernfitness.co.uk/Image.jpg Below the recent posts that are listed, you will see 'Previous Page - 1 2 3 4 5 - Next Page' - this is what I'm trying to create. I don't really have any idea how I would go about coding this page so that when a user clicks on '2' they are taken to the second page of most recent posts and so on with 3 and 4 (obviously depending on the number of posts). Is it best to have the user go to a completely new page when clicking on a number/previous page/next page or would it be best to keep them on the current page and just have the information dynamically change? I hope I've explained this well enough so that you understand. I don't expect you to tell me exactly how to do it, but if you could point me in the right direction or just give me an idea that would be great. Many Thanks, Ali
  4. Success! Sort of I think I need to get rid of the anchor and fiddle around but hopefully we are pretty much there now! Thanks Evu, Ali (hopefully you're free now
  5. Thanks Evu. It's only because I have such little knowledge of JS it'd be like a dog chasing it's tail round in circles all day.
  6. Thanks Evu! Have put your code in. Will see how it turns out once the CSS updates (cheers Varnish Caching!). I have a feeling I may need you to tinker with it a little if you have the time. (But fingers crossed it works straight out!) Thanks, Ali
  7. Strangely, it seems that only the CSS file is having trouble updating! Site is using WordPress.
  8. Hi Guys, I've just got a hosting package with iPage not realising that they use Varnish Caching. This means that any edits I make to a file and then upload to the server, as standard it takes 20-30 MINUTES for these updates to be seen online. As you can imagine, this is absolutely ridiculous. I've tried talking to the tech support but they aren't that helpful - they said they've been able to change the update time to 2-3 minutes but still, that is crazy. Therefore! I've decided it's down to me to try and find a solution (if possible from remote) to make these updates immediate. Does anybody have the slightest idea how to get around this extremely frustrating problem? Any help is greatly, hugely, massively appreciated! Thanks, Ali (Cheers iPage ...pfff!)
  9. Hi Jochemke, I finally have the basics of the site up to start playing about with the coding for this tabbed box. Are you still able to help me with the coding of it? http://silverfernfitness.co.uk Many Thanks! Ali
  10.    Hitch - CP reacted to a post in a topic: Best way to create ...
  11. Hi Guys, I am wondering what the best way to create the following would be: As seen in the picture (design), there are four 'tabs' on the left that control content in the main box to the right. I need to create it so that when one of the tabs is clicked, their respective content is shown in the box on the right and the tab arrow becomes 'active'. You could say I am a novice in terms of coding, so don't feel bad about dumbing it down for me! Many Thanks, Ali
  12. Hey Guys, Woah long time since I've been on here! Busy Busy. Anyway, having problems with getting Firefox to render text-gradients using just CSS. (Can't even test in IE as I can't seem to download IE9 but that's a whole other issue) Example Site Above is the web page in question. When viewed in Chrome, there is a lovely text-gradient on the h2 tag below the main picture on the word 'twitter'. However! I am at a loss as how to reproduce this in Firefox. I've searched high and low through the internet to find a solution but am coming up very short. Any body have any ideas as to how I can fix this? P.S. Using a transparent 1px PNG file as a background image won't work as my background isn't a uniform colour. Thanks! Ali
  13. Ahh, many thanks yet again mteam. I just read up on this and now understand why. Ali
  14. Hey Guys, The problem can be seen at: www.alihitch.com/projects/rgmotors The site uses HTML5 and some CSS3 features - it all appears to be working perfectly when viewed in Chrome but not in IE and Firefox. I can understand it not showing up properly in IE but I'm suprised it isn't working in Firefox - it looks wrong in the exact same way in both browsers, oddly ... Anybody know why this issue is occuring and have any thoughts on how to fix it? Many Thanks, Ali
  15. Ahh. I took a look at your problem but that's a JS problem from a quick glance and as we all know, I'm a JS Newbie. Sorry can't help.
  16. Oh no, it is working Chrome must have just been playing up - Grrrr Thanks for all the help guys! No doubt I'll be back again. Ali

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.