benners_
Forum Replies Created
-
Can we get these assets minified please? This is basic practice these days and it is throwing up warnings messages in varies tools we use to launch quality sites with good performance and SEO.
Forum: Plugins
In reply to: [Adaptive Images for WordPress] Images not being created but no debug errorsHi Takis
Thanks for your help, I’m sure that’s the issue. I expected WPEngine’s environment was the issue.
Paul
Forum: Fixing WordPress
In reply to: Pagination Showing Same Records on Each PageIn case this helps anyone, the problem was I didn’t include the ‘paged’ parameter and had nothing to do with the custom pagination function I was using.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array ( 'post_type' => 'event', 'pagination' => true, 'paged' => $paged, 'order' => 'DESC', ); global $wp_query; $wp_query = new WP_Query( $args ); if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); // Get content endwhile; pagination(); else : // Not found endif;Forum: Fixing WordPress
In reply to: Pagination Showing Same Records on Each PageOK, thanks for trying to assist. Will try Mintithemes Forum.
Forum: Fixing WordPress
In reply to: Pagination Showing Same Records on Each PageI’ve made an error thinking pagination() was a WP function as I found what I thought was a reference for it https://codex.wordpress.org/Pagination
This is the function from the parent theme I’m using.
function pagination($pages = '', $range = 4) { $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 "<span class='allpages'>" . __('Page', 'minti') . " ".$paged." " . __('of', 'minti') . " ".$pages."</span>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« " . __('First', 'minti') . "</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ " . __('Previous', 'minti') . "</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)."\">" . __('Next', 'minti') . " ›</a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>" . __('Last', 'minti') . " »</a>"; } }Forum: Plugins
In reply to: [Post Types Order] Next Link For Last Record Does Not Go To First RecordThanks for the reply. Not sure what you mean by
create a list of posts and extract next / previous one
could you clarify please? Thanks.
Forum: Plugins
In reply to: [Simple Fields] Repeatable fields returning value of 1 for delete valuesI’m using a Repeatable Post type field. Yes a Post selected may have been deleted. Shouldn’t the plugin clear all values when a Post is deleted? Thanks
Forum: Fixing WordPress
In reply to: Can't get categories assigned to a custom post typeWould be nice to know why the standard APIs don’t work but I got what I need with this.
$categories = $wpdb->get_row("SELECT wp_terms.name, wp_terms.slug FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_terms ON (wp_term_relationships.term_taxonomy_id = wp_terms.term_id) WHERE wp_posts.ID = ".$post->ID, ARRAY_N); if($categories){ $get_my_cats = ''; foreach($categories as $key => $value ) { if($key == 'name') { $get_my_cats .= "<li>".$value."</li>"; } } $get_my_cats = "<ul>".$get_my_cats."</ul>"; }