Multiple WP_Query args combinations according to post type
Multiple WP_Query args combinations according to post type
Multiple WP_Query args combinations according to post type
If you want the image URL you should use wp_get_attachment_image_url(), not wp_get_attachment_image(): $background_image_id = get_post_meta(get_the_ID(), ‘your_background_image_id’, true); $background_image = wp_get_attachment_image_url( $background_image_id, ‘full’ ); $profile_image_id = get_post_meta(get_the_ID(), ‘your_profile_picture_id’, true); $profile_image = wp_get_attachment_image_url( $profile_image_id, ‘full’ ); ?> wp_get_attachment_image() returns a full HTML <img> tag, but background images are just a URL.
How to get posts by meta value as multi-dimensional array?
For 99% of cases, no, you can’t. Serialised data is not something you can search, and that is the fundamental problem. Not how to search it, but that it was serialised to begin with. Serialising is unnecessary. This is for the same reasons you cannot unscramble an egg, serialised data, especially PHP serialised data, is … Read more
Usermeta data unserialize, extract and display in table in WordPress
meta_query is overriding default search
Meta query ignores multiple values of the key
Querying terms with calculations based on term meta data, sql vs. get_terms
What you’re trying to do — using the OR relation with the tax_query and meta_query parameters, i.e. to have a <tax queries> OR <meta queries> instead of <tax queries> AND <meta queries> command in SQL, unfortunately (without custom and possibly complex queries) is not possible in WP_Query for now, therefore that ‘relation’ => ‘OR’ in … Read more
So i got it working, by adding a filter: i added this before the wp_list_pages add_filter( ‘get_pages’, ‘check_propper_rank’, 10, 2 ); wp_list_pages( array( ‘post_type’ => ‘wiki-term’, ) ); and then created a new filter, to removed the ones that did’nt fit the rank. function check_propper_rank( $pages, $arguments ) { $user_rank = 100; foreach ( $pages … Read more