Tag Info

Hot answers tagged

4

This is a shortcode you see there in the post/page content. It's most likely displaying all the child pages (up to depth 1) of the current page. Shortcodes are very common, but you can't see their output in the WordPress post/page editor, only on the front end where it's generated via the do_shortcode() function. The "hard" way: So you can try do the ...


3

What you are doing is incredibly dangerous. You can break your site horribly, or have your entire server hacked. With a PHP in content plugin there is nothing stopping an editor from copy pasting a PHP shell in to the content editor and taking full control of your site. If you have content on a page and want to include custom code, you should use one of the ...


2

Your code will never get to the is_page_template() if statement because is_page_template() can only be true when is_page() is also true. It also looks like you've got some muddled elseif syntax (I think that's what you want?) and some generally inefficient code that repeats a lot. I'd do this: <?php if( is_page_template('right-sidebar.php') ) { // ...


2

May be something is wrong on your page template file. Have your added page template name at top of the page like this: <?php /* Template Name: My Custom Page */ Try with this and check once again. You can check WordPress document for creating custom page template. Check this link: Page Templates


1

According to the Codex, your custom page template must have a header containing the name of the template. All page templates must be named in this way, or they will not appear in the "Template" dropdown. Here's an example, make sure your custom template has a header in this format: <?php /* Template Name: My Custom Page */ // Your custom page template ...


1

You could modify it through the the_author filter: /** * Set the author name as the site title. */ ! is_admin() && add_filter( 'the_author', function( $author ) { return get_bloginfo( 'name' ); } ); where we change the author name to the site name on the frontend with the help of the get_bloginfo() function.


1

For things like that a page is better option, because you can make use of custom page templates and also because pages are a better place for inner secondary queries. As example, if you want to use pagination for secondary queries, alongside next_posts_link() and previous_posts_link(), both those functions check if ( ! is_single() ) to display pagination ...


1

Instead of having a page template for all of them, have a single page template and use get_template_part to pull in the parts unique to each page. So instead of: update_post_meta($new_page_id, '_wp_page_template', $page_filename); You'd have: update_post_meta( $new_page_id, '_wp_page_template', 'newpagetemplate.php' ); update_post_meta( $new_page_id, ...


1

after you delete a page ,on the "all pages" section, on the top, after the "drafts", there is link to trash, go there and delete it permanently, after this you can change the slug name.


1

Create page templates inside your theme and create page-{template-name}.php for each one of them and you need to code the appropriate query for each case. Then go to each page inside admin panel, open each page and just assign each page to their matching template. If you are not familiar with how to do any of the above, provide the code of your current ...



Only top voted, non community-wiki answers of a minimum length are eligible