Jump to content

slaterino

Members
  • Posts

    128
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

slaterino's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I am currently using a simple array with a grid layout that outputs from Wordpress, which allows me to specify the three columns of the grid. Now, I am wanting to add something hard-coded into the third column of the first row. Which essentially means that my array would need to go 'first,second' for the first row (then I will add my hard-coded item in the third column) and then 'first,second,third' infinitely after that. Is there any way that this is possible to implement practically, so that the array just goes 'first' and 'second' and then switches to the 'first','second,'third' array? Here's the current code that I'm using: $style_classes = array('first','second','third'); $styles_count = count($style_classes); $style_index = 0; <div class="grid_5 <?php $k = $style_index % $styles_count; echo "$style_classes[$k]"; $style_index++; ?>">
  2. Hi, I'm having a real problem with one of my Wordpress category pages. I use a 3-column grid system on this page and just recently I needed to add an advert to the page, so I thought I would do one query at the top with the first two posts, then add the advert to complete the row. Then I would use a second query underneath creating the posts using the traditional grid system with 3 in each row. This is working well except for the pagination, which adds the two items form the first query everytime it paginates. You can see this in action at http://soundsandcolours.com/music/ Does anyone know what I can do to make the Pagination ignore the first query, and just keep running the second query instead. I've included all of my code below: 1st Query: $query_string; $musiccat_posts = new WP_Query($query_string."&posts_per_page=2"); if ($musiccat_posts->have_posts()): $musiccatIDs = array(); while($musiccat_posts->have_posts()):$musiccat_posts->the_post(); $musiccatIDs[] = get_the_ID(); 2nd Query: $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; global $moremusiccat_query; $music_args = array( 'cat' => 1841, 'posts_per_page' => 15, 'post__not_in' => $musiccatIDs, 'paged' => $paged ); $moremusiccat_query = new WP_Query( $music_args ); while ($moremusiccat_query -> have_posts()) : $moremusiccat_query -> the_post(); ?> Pagination Code: $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $moremusiccat_query->max_num_pages ) ); Any help would be massively appreciated!
  3. Hey, that's what I thought too. However, none of the files listed actually ever existed, which is why I think there has been some hacking at some point that is causing the problem.
  4. Hi, Apologies if this isn't the right forum for this question. I couldn't find the perfect forum for my question, but I'm hoping someone can help. Basically, I've been having problems with a site I manage, with the site going down regularly, 401 Forbidden error pages cropping up reguarly, as well as Server Configuration Error pages, although only ever sporadically. I've been trying everything to work out the issue but no luck as of yet. However, one thing that seems strange is the following messages that I'm getting in the access logs. Now, this shouldn't be a problem as Facebook often creates messages like these when it's accessing files from a server. However, there are thousands of messages like this that reference files that don't exist. Honestly, it's constantly trying to access .jpg files that don't exist, and so I suspect this is what's causing the server to keep crashing. Has anyone had anything similar to this before? comono.co.uk 173.252.88.88 - - [20/Nov/2015:13:13:46 +0000] "GET /uploads/2009/9/28/873128bf77.jpg HTTP/1.1" 403 379 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)" Thanks, Russ
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.