Showing main menu and child menu in diffent places in a same page
Showing main menu and child menu in diffent places in a same page
Showing main menu and child menu in diffent places in a same page
May I suggest you provide details as to the exact problem, and what the results are of your example code? Also, it seems like you are saying that the pages you want to get the titles of are siblings of the parent, which is the home page, so in fact, they are not children at … Read more
Pages redirecting to homepage
No, unfortunately this is inherent limitation of PHP templates used in WordPress natively. You will have to override either this template file, or file(s) which include it, but in any case something will have to be replaced on whole file scope. There is no clean way to load template file partially in WordPress, which is … Read more
I believe that it will be hard for you to accomplish that without some javascript because you are adding the link manually. However, you can achieve the same thing in another way: Most wordpress themes come with a body_class() function in the <body> tag. That function adds several classes to the body tag that allows … Read more
Your problem is that you are putting the page result in $page. While the normal commands like the_title() and get_field() will look for the $post variable if you are not setting a seperate ID of which you want the title. I once did this by creating a backup of the $post variable, and then just … Read more
It looks like the problem is with your IF statement. if($post->ID = 142) should be if($post->ID == 142) (notice the 2 equals signs) Otherwise you are just resetting the variable $post->ID to 142
Why don’t you just use the build in features to page your results WP_Query Pagination Parameters next_posts_link() previous_posts_link Just simply add the paged parameter to your query arguments, and don’t forget to set the $max_pages parameter in next_posts_link()
How to copy specific page content and create child page?
I solved it using ‘menu_order’: function parent_menu_order($post) { if( isset($post->post_parent) ) { if($post->post_parent == 0) { return $post->menu_order; }// if no parent, return it itself $post_data = get_post($post->post_parent); return $post_data->menu_order; } else { return -1; } }