Moofin
Forum Replies Created
-
Forum: Plugins
In reply to: [Import Tweets as Posts] Tweets not being importedSame issue here. It used to work on my website then when I moved the site to the live server it no longer works.
I’ve tried removing / reinstalling and the WP Cron job. Nothing working as of yet.
Forum: Plugins
In reply to: [Simple Membership] My custom fields aren't hiddenSo I think I found it out by using the following:
$au = BAuth::get_instance(); if ($au->is_logged_in() ) { if( have_rows('download_file_list') ): echo '<h2>Downloads</h2>'; echo '<ul class="downloadList">'; while ( have_rows('download_file_list') ) : the_row(); echo '<li><a target="_blank" href="'.get_sub_field('upload_file').'">'; the_sub_field('file_name'); echo '</a></li>'; endwhile; echo '</ul>'; endif; }
Forum: Fixing WordPress
In reply to: wp_query and paginationOOo, I figured it out. In the end I added:
$c++; if( $c ==1 ) continue;
So for those ever interested here is my final code:
<!-- Featured Post --> <?php $args = array( 'post__in' => array(), 'cat' => get_query_var('cat'), 'showposts' => 1, 'order' => 'DESC', ); $featured = new WP_Query( $args ); while( $featured->have_posts() ) : $featured->the_post(); ?> <div class="arcfeaturepost"> <h2><a class="highlight" href="<?php the_permalink();?>"><?php the_title(); ?></a></h2> <?php if ( has_post_thumbnail() ) { ?><div class="arcfeature"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div><?php } ?> <?php the_excerpt('65');?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> <?php endwhile; wp_reset_postdata(); ?> <!-- Post Archive Loop --> <?php while( have_posts() ) : the_post(); $c++; if( $c ==1 ) continue; ?> <div class="arcpost"> <div class="arcimg"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div> <div class="arctxt"> <h3><?php the_title(); ?></h3> <?php the_excerpt_dynamic(200,'no')?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> </div> <?php endwhile; ?> <!-- Page Navigation --> <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
Thank you so much for all the help Shaun – I definitely wouldn’t have been able to do it without you!
Forum: Fixing WordPress
In reply to: wp_query and paginationHi Shaun,
Thank you so much, this really helped. I’ve tweaked it slightly as some parts weren’t working for me (it was grabbing all the categories) and I changed the order to DESC.
My only problem now is trying to get the post archive loop to not show the most recent post, before I was using the ” ‘offset’ => 1 ” but I can’t seem to replicate that – any ideas?
<!-- Featured Post --> <?php $args = array( 'post__in' => array(), 'cat' => get_query_var('cat'), 'showposts' => 1, 'order' => 'DESC', ); $featured = new WP_Query( $args ); while( $featured->have_posts() ) : $featured->the_post(); ?> <div class="arcfeaturepost"> <h2><a class="highlight" href="<?php the_permalink();?>"><?php the_title(); ?></a></h2> <?php if ( has_post_thumbnail() ) { ?><div class="arcfeature"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div><?php } ?> <?php the_excerpt('65');?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> <?php endwhile; wp_reset_postdata(); ?> <!-- Post Archive Loop --> <?php while( have_posts() ) : the_post(); ?> <div class="arcpost"> <div class="arcimg"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div> <div class="arctxt"> <h3><?php the_title(); ?></h3> <?php the_excerpt_dynamic(200,'no')?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> </div> <?php endwhile; ?> <!-- Page Navigation --> <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
Thank you for taking the time to do this, as you can tell I’m a bit of a PHP novice so I’m learning new approaches constantly!
Edit: I should add that I tried adding an array before the ‘while posts’ for the second archive loop to try and add the offset bit there, but it didn’t seem to work and it broke the pagination again.
Forum: Fixing WordPress
In reply to: wp_query and paginationOkay, so I had a look at the get_posts tag and have implemented it so it’s working/displaying how I’d like it. However, I still can’t get the pagination to work. I don’t know if it’s because of how I have it setup.
It’s a magazine type blog so what I’m trying to achieve is:
==FEATURED POST WITH BIGGER IMAGE AND MORE EXCERPT & different styling ==
then directly underneath a small list which will have a thumbnail, small excerpt etc.
This is what I have now:
<?php global $post; $args = array( "cat" => get_query_var('cat'),'showposts' => 1 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <div class="arcfeaturepost"> <h2><a class="highlight" href="<?php the_permalink();?>"><?php the_title(); ?></a></h2> <?php if ( has_post_thumbnail() ) { ?><div class="arcfeature"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div><?php } ?> <?php the_excerpt('65');?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> <?php endforeach; ?><!-- end FIRST CATEGORY POST FEATURE --> <?php global $post; $args = array( "cat" => get_query_var('cat'),'offset' => 1 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <div class="arcpost"> <div class="arcimg"><a href="<?php the_permalink();?>"><?php the_post_thumbnail(); ?></a></div> <div class="arctxt"> <h3><?php the_title(); ?></h3> <?php the_excerpt_dynamic(200,'no')?> <p><a class="readmorea" href="<?php the_permalink();?>">READ MORE ></a></p> </div> </div> <?php endforeach; ?> <div class="navigation"> <div class="alignleft"><?php previous_posts_link('? Previous') ?></div> <div class="alignright"><?php next_posts_link('More ?') ?></div> </div>
Have I done it incorrectly?
Thank you for this! ??
Forum: Fixing WordPress
In reply to: Exclude category from loop problemsHi Jkovis – thanks for taking the time to reply!
I tried your suggestion and this is what it sent out:
[cat] => -19 [orderby] => wp_posts.post_date DESC [order] => DESC [error] => [m] => 0 [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [static] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [tag_id] => [author_name] => [feed] => [tb] => [paged] => 0 [comments_popup] => [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [fields] => [category__in] => Array
There was more but this was the bulk of it. Interestingly enough when I uploaded it to a live server (I was working locally before) the order was working correctly. I’m still not sure why it doesn’t work locally as I see no reason for it to be any different.