How do I insert CSS into a function?
You could do this with jQuery. Like so … $(“a:contains(‘Newer’)”).addClass(‘YourNewerClassHere’); $(“a:contains(‘Older’)”).addClass(‘YourOlderClassHere’);
You could do this with jQuery. Like so … $(“a:contains(‘Newer’)”).addClass(‘YourNewerClassHere’); $(“a:contains(‘Older’)”).addClass(‘YourOlderClassHere’);
Found the answer!!! Put this in functions.php (or a required file). Of course, change it to suit your needs. I needed something that only worked for product category archives. function modify_product_cat_query( $query ) { if (!is_admin() && $query->is_tax(“product_cat”)){ $query->set(‘posts_per_page’, 2); } } add_action( ‘pre_get_posts’, ‘modify_product_cat_query’ ); I also took out the posts_per_page parameter from my … Read more
Try changing $my_query to $wp_query to see if that fixes the issue. I found that when you rename the query it messes with the pagination. Also you should move the reset query after the pagination. Here’s a loop I’ve verified works with pagination: $args = array( ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘paged’ => get_query_var( … Read more
I doubt you could paginate within a post display. It would be more effective to display all the image attachments at the page load, and have a script do the pagination. You can find a lot of them on such sites: http://www.themeflash.com/30-powerful-jquery-slideshow-sliders-plugins-and-tutorials/ You need to be able to edit your template files, specifically the header … Read more
<?php /* Template Name: Portfolio */ ?> <?php get_header(); ?> <div id=”full_container”> <div id=”portfolio_content”> <div id=”portfolio_wrap”> <div id=”content”> <?php $loop = new WP_Query(array(‘post_type’ => ‘portfolio’, ‘posts_per_page’ => 2)); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php $custom = get_post_custom($post->ID); $screenshot_url = $custom[“screenshot_url”][0]; $website_url = $custom[“website_url”][0]; ?> <a href=”https://wordpress.stackexchange.com/questions/30616/<?php the_permalink() ?>”> <span class=”img”> <?php … Read more
wordpress pagination, links appear but go nowhere when clicked
Do a search through your theme’s entire directory for the functions “is_home()” and “is_front_page()”. The only thing I can think of is that there’s a function written somewhere that makes the front page have 8 posts no matter how many posts are set per page on the rest of the blog.
Here’s what I found which I’ll break up into pieces: for ($i = 1; $i <= 12; $i++) { $month = date(“n”, strtotime( date( ‘Y-m-01’ ).” -$i months”)); $year = date(“Y”, strtotime( date( ‘Y-m-01’ ).” -$i months”)); The for loop will loop through how many months we want to pull, which in this case is … Read more
Display only the current page number and another numbered page in pagination
Custom query in archive.php with pagination nightmare