| bio | website | |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 8 months |
| seen | yesterday | |
| stats | profile views | 0 |
|
1d |
accepted | Accessing post->ID outside of the loop for listing child pages |
|
1d |
comment |
Accessing post->ID outside of the loop for listing child pages let us continue this discussion in chat |
|
1d |
comment |
Accessing post->ID outside of the loop for listing child pages Yes, I'm on my home.php page, though I do want this to appear on every page eventually. |
|
1d |
comment |
Accessing post->ID outside of the loop for listing child pages <?php wp_list_pages('title_li=&child_of='.get_queried_object_id()); ?> - this returns all pages as if there was no filter being applied |
|
1d |
comment |
Accessing post->ID outside of the loop for listing child pages Thanks for the reply. I'm happy to give anymore information I'm fairly new to this kind of stuff that's why my question may be a bit specific? - I've just tried replacing $post->ID with get_the_ID() and had no luck |
|
1d |
comment |
Accessing post->ID outside of the loop for listing child pages thanks for the reply. I get this code: pastebin.com/JKb1gcfX |
|
1d |
asked | Accessing post->ID outside of the loop for listing child pages |
|
1d |
accepted | Listing current pages subp page in list items in the sidebar |
|
1d |
asked | Listing current pages subp page in list items in the sidebar |
|
Jan 31 |
awarded | Tumbleweed |
|
Jan 24 |
accepted | Custom Post Type Taxonomies -Posts not showing in Category or Tag pages |
|
Jan 23 |
comment |
Custom Post Type Taxonomies -Posts not showing in Category or Tag pages Further to this it now deletes my "Pages" and "Posts" content and shows only the member-resources posts in these areas? |
|
Jan 23 |
comment |
Custom Post Type Taxonomies -Posts not showing in Category or Tag pages Ok, so I found this little bit of code on the codex - add_action( 'pre_get_posts', 'add_my_custom_post_type' );
function add_my_custom_post_type( $query ) {
if ($query->is_main_query())
$query->set( 'post_type', array( 'member-resources' ) );
return $query;
}
This works a charm, so it seems. But I'm baffled why, by default my custom post types are not being shown in tags and category pages?
I have even registered them in the CPT. Could anyone explain why this is? |
|
Jan 23 |
asked | Custom Post Type Taxonomies -Posts not showing in Category or Tag pages |
|
Sep 4 |
awarded | Scholar |
|
Sep 4 |
accepted | Make a wordpress site similar to Hot Or Not - Image rating system |
|
Sep 3 |
asked | Make a wordpress site similar to Hot Or Not - Image rating system |