Tag Info

New answers tagged

0

Ok. This code: $cat_id_gum=""; if(($category[0]->parent)!='0') { $cat_id_gum=$category[0]->cat_ID; } elseif(($category[1]->parent)!='0') { $cat_id_gum=$category[1]->cat_ID; } elseif(($category[2]->parent)!='0') { $cat_id_gum=$category[2]->cat_ID; } else { $cat_id_gum=$category[3]->cat_ID; } Is not really necessary. ...


1

Use pagename instead of page_id to query by slug. Note that if a page is a child of another page, pagename has to be the full parent/child path to the page, since slugs only have to be unique per-level in hierarchical post types. See WP_Query for the full list of query vars.


0

You can try selecting the $post_id where $page_name = $page_name


0

The issue I worked out was that I'd previously built another form on my staging site using CCF, I went through phpmyadmin posts and deleted everything ccf-based then rebuilt my form and since there were no previous forms this form was assigned the id 122 and my template now works :) It would still be good to know if there's a way to search for wildcards ...


1

There is only one default term in Wordpress, that is the term uncategorized from the taxonomy category. This term is created when Wordpress is first installed. This term's ID will always be 1 if it is not altered in any other way by some custom code from a custom theme or plugin. Term ids, like post ids, are very reliable and does not change within a ...


1

For mee it seems that the template_redirect hook worked. Thanks to Pieter Goosen. Heres a solution that should work on earlier hooks: function gdymc_object_exists( $object_id ) { return ( get_the_title( $object_id ) ) ? true : false; } function gdymc_objectID() { if( is_numeric( $_GET['page_id'] ) ): $object_id = $_GET['page_id']; ...


0

You can use the same method as described in the link you mentioned, but simply use the created user ID and add 1000 so you get four digits. So user_id = 5 gets the meta number of 1005. add_action( 'user_register', 'my_on_user_register' ); function my_on_user_register( $user_id ) { $unique_id = 1000 + $user_id; update_user_meta( $user_id, ...



Top 50 recent answers are included