326 reputation
14
bio website
location
age
visits member for 1 year, 2 months
seen Apr 13 at 6:33

Formerly an Excel spreadsheet developer now a student of WordPress, PHP and MySQL.


Apr
12
comment short code function stopped working when switching to php 5.4
What action is 'other'?
Apr
12
comment How does routing on wordpress work?
If your website requires custom programming on most of its pages then probably WordPress is not the right choice. I myself personally like the approach taken by concrete5 but find WordPress more viable because of its vast ecosystem - it probably has the largest collection plugins by far (of course some of those are just plain junk). Certainly, "the loop" logic shows its blogging origins but WordPress has evolved to be much more capable but it isn't a generic framework. If your requirements does not match "the loop" logic you are probably better off with something else.
Apr
12
comment there's something like re-route concept in wp?
The action parse_query has a single argument - the WP_Query object which is passed by reference so you can modify it. In particular, you can modify the flags that specify the kind of query it is. Note this will not change the posts that are displayed only how they are displayed.
Apr
12
comment there's something like re-route concept in wp?
If you are trying to modify the query I would try the filter posts_where and/or the action parse_query. I use posts_where to change what posts are displayed, parse_query to change the attributes of the query - flags like is_category, is_tag, is_search, is_singular, ... then I use template_redirect to change the template.
Apr
12
comment there's something like re-route concept in wp?
Have you considered the action template_redirect?
Apr
12
comment How does routing on wordpress work?
I see from one of your previous questions that you are using the Pods plugin. This is a good example of the flexibility of WordPress. Pods does not use the builtin WordPress logic - query for posts and display posts using the loop. It replaces this with its own custom logic. It can do this because WordPress actions allows you to easily modify the default behavior of WordPress. And you can still use the all the capabilities of a very vast ecosystem built around WordPress.
Apr
12
comment How does routing on wordpress work?
@yeahman: I rather disagree with some of your judgements on wordpress - is a bit weird and not very flexible, very ugly approach, not a very portable approach. Although the builtin logic of wordpress would not be suitable for all kinds of website I think it much more flexible, portable and elegant than you can appreciate from working with it for only a little while. If you gain more experience with it I think you will find you can do much more than you seem to think. You really need to understand actions, filters, shortcodes, widgets, ... before you can pass a fair judgement.
Apr
12
comment How does routing on wordpress work?
May I suggests that you read about "the loop" which is the concept that you need to understand to know how WordPress works. Essential "the loop" displays an array of posts which is the result of query_posts. For non-admin URL requests WP is designed to show only posts and it takes custom programming to show something besides a post. Admin URL requests are different and these do not use "the loop" and show non posts things.
Apr
6
comment SQL query to remove first image in all posts
Has this been actually tested? The regex doesn't look right to me - what are you trying to match with "[img]" or "[.]*"?
Apr
6
comment wp_enqueue_scripts called twice?
try - error_log( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ) ); - to see how the calls are invoked
Apr
3
comment Page has a parent and $post->post_parent returns 0
"I have several pages with a parent." - What makes you believe that this is true?
Apr
3
comment Ajaxurl suddenly not defined
If you have the time, I would be interested in knowing if the change I suggested would also work. If you are too busy don't worry about it - I am just curious.
Apr
3
comment Ajaxurl suddenly not defined
403 forbidden was sent by the HTTP server so your PHP code did execute it just generated a bad URL.
Apr
3
comment Ajaxurl suddenly not defined
Try var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>';
Apr
3
comment Get first post from wp_query
Try $connected->posts[0]->post_name - $connected is an WP_Query object which contains a posts array member.
Apr
2
comment How to show a post if was published less than two hours ago?
Why don't you just take the difference of the UNIX timestamps?
Apr
1
comment meta_compare not comparing whole integer
Should not 'meta_value' =>$i_rate, be 'meta_value_num' =>$i_rate,
Apr
1
comment Replace all of post's image URLs with upload directory URLs
content_save_pre is a filter. return result of preg_replace() which does not modify its argument.
Apr
1
comment Change Wordpress Shortcode added in to post
Yes, the [gallery ...] shortcode is actually never changed in the post_content but the gallery shortcode handler is replaced with one that just calls the wp-slideshow shortcode handler instead. I don't think it is a good idea to change the standard gallery shortcode. Also, see next answer for a more efficient way to do this.
Mar
31
comment term_id a 13 character string, not an integer. How do I replicate this?
In the table wp_term_taxonomy are the term_ids corrupted only for the taxonomy product_cat or are term_ids of other taxonomies also corrupted. If so is there anything in common about the taxonomies with corrupted term_ids?