muhammadwaqas
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: 500 Internal Error and Accounts GoneCan’t say anything without looking at error logs. Do you have access web hosting panel or ftp? Debug your WordPress and then share logs here
Forum: Fixing WordPress
In reply to: 500 Internal Error and Accounts GoneIs it the result of upgrading any plugin or you edited any code at live website?
Do you have access to server logs?Forum: Developing with WordPress
In reply to: admin_post_thumbnail_html changed since Gutenberg?Has anyone found solution to add this option into block editor? It appears block editor is entirely based in javascript so I think we can’t use php filter any more. In order to use these filter we will have to learn a lot of coding to process javascript variables through wp api. Sigh!
Forum: Plugins
In reply to: [Imsanity] Automatic resizing doesn't work on nginxSorry, Its working now. There was a user permission issue.
Forum: Fixing WordPress
In reply to: regex meta key for meta_queryThanks Awais I’ll look into this. I know about serialized data in post_meta. Infact I’m saving some of my site data in this manner.
But specifically for locations I wanted to keep it simple because that meta key is being used at several other functions.
Thanks for your time. I’m on to building it now.
Forum: Fixing WordPress
In reply to: regex meta key for meta_queryThanks for the reply. I think thats the only solution for this. Creating multiple meta_query using foreach;
$locations = array('location-1','location-2', 'location-3'); $main_array = array(); foreach ($locations as $area) { //how do I do this part?? $main_array[] = array( 'relation' => 'OR', array( 'key' => $area, 'compare' => '=', ), array( 'key' => $area, 'compare' => 'NOT EXISTS' ) } $args = array( 'meta_query' => array( $main_array ), 'orderby' => 'meta_value_num', 'order' => 'DESC', ); $query = new WP_Query($args);
PS: Even if it was possible to use regex. That wouldn’t be a good idea either. Because then it will include all the locations ignoring which locations related to which user. ??
Forum: Fixing WordPress
In reply to: regex meta key for meta_queryI understand that array isn’t acceptable for ‘key’ also I know hardcoding all key works.
The problem is not only these keys are different for each user but also are different in numbers.
For example; some users can have 3 locations and some can have 15 or so.
Forum: Plugins
In reply to: [Simple Rating] Stars showing, but can't voteWordPress SEO doesn’t add any js in head/body. So there is no question that rating plugin could create conflict.
You might have missed seeing any other conflicts. I’m still using version 1.3.2 with wordpress SEO 1.5.3.3, W3Total cache 0.9.4 and tons of other jQuery functions in my theme. Everything is smooth.
Using WP 3.9.1
Forum: Plugins
In reply to: [Simple Rating] Which file is changed in 1.3.3Actually I customized my version.
Pardon me for confusion. Now I noticed changes in js files. php functions are unchanged except version info ??
Thanks for replying.
Forum: Plugins
In reply to: [Simple Rating] Which file is changed in 1.3.3I compared js, there are no changes in that.
Thats me there.
Forum: Fixing WordPress
In reply to: A little help with numbered pagination?I’ve found a solution. But it doesn’t include the custom styling of pagination links.
function oenology_paginate_archive_page_links( $type = 'plain', $endsize = 1, $midsize = 1 ) { global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; // Sanitize input argument values if ( ! in_array( $type, array( 'plain', 'list', 'array' ) ) ) $type = 'plain'; $endsize = (int) $endsize; $midsize = (int) $midsize; // Setup argument array for paginate_links() $pagination = array( 'base' => @add_query_arg('paged','%#%'), 'format' => '', 'total' => $wp_query->max_num_pages, 'current' => $current, 'show_all' => false, 'end_size' => $endsize, 'mid_size' => $midsize, 'type' => $type, 'prev_text' => '<<', 'next_text' => '>>' ); if( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( 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 ); }
The result appears like this:
<span class='page-numbers current'>1</span> <a class='page-numbers' href='/?paged=2'>2</a> <span class="page-numbers dots">…</span> <a class='page-numbers' href='/?paged=4'>4</a> <a class="next page-numbers" href="/?paged=2">>></a>
Can we change rewrite the html markup in this function?
Forum: Fixing WordPress
In reply to: Hacking numbered paginationThank you once again. I’m makring this topic as resolved ??
Forum: Fixing WordPress
In reply to: Hacking numbered paginationPerfect, its working. Now the result is
<a href="/page/2" >2</a> <a href="/page/3" >3</a>
Althought I don’t need
<a href="/page/3" >3</a>
, because I’m using infinite scroll. But still its working ??The above code has a syntex error, So here is the good one.
<?php if($new_query->max_num_pages>1){?> <p class="pager"> <?php for($i=2;$i<=$new_query->max_num_pages;$i++){?> <a href="<?php echo get_category_link($category_id).'/page/'.$i;?>"><?php echo $i;?></a> <?php }?> </p> <?php } ?>
Thank you martha_camellia.
Forum: Fixing WordPress
In reply to: Prev / Next Post navigation in single.php skipping postsHere is the code, Thank you.
No, the posts are in same category “Uncategorized”<?php $prev_post = get_adjacent_post(false, '', true); $next_post = get_adjacent_post(false, '', false); ?> <?php if ($prev_post) : $prev_post_url = get_permalink($prev_post->ID); ?> <span class="prev"><a href='<?php echo $prev_post_url; ?>' rel='prev'>?</a></span> <?php endif; ?> <?php if ($next_post) : $next_post_url = get_permalink($next_post->ID); ?> <span class="next"><a href='<?php echo $next_post_url; ?>' rel='next'>?</a></span> <?php endif; ?>