New answers tagged

0

This notice isn't helpful. On the same page there is something like: Revisions: 29 Browse After you have clicked Restore the backup, you can click on Browse. This will take you to the revisions of the page. If you move the slider all the way to the right, it will display an [Autosave] revision. You can click Restore This Revision to recover the ...


1

This sounds like the wrong way around and always having the danger of forgetting or misconfiguring something. If you need content separation, just use a network install. It has a little more overhead of admin but it out of the box ensures the content separation you seek.


0

Okey, the problem is now solved. I had used both the parameters 'loop' and 'page' for the get_template_part function in the custom template's content php code. I removed the 'loop' parameter and ... voila , it works fine now.


0

Try this: function shortcode_func( $atts ) { ob_start(); echo 'shortcode output'; $output = ob_get_contents(); ob_end_clean(); echo $output; // Here comes the total output of your shortcode } add_shortcode( 'shortcode', 'shortcode_func' );


0

You can try get_pages like this way: <?php $args = array( 'child_of' => 'YOUR PAGE', 'parent' => 'YOUR PAGE', 'post_type' => 'attachment', 'post_status' => 'publish', 'numberposts' => -1 ); ?> NOTE: child_of Note that the child_of parameter will also fetch "grandchildren" of the given ...


0

I'm assuming we're viewing a "Page" titled "Home"? Be sure that Settings > Reading has "Front page displays" set to either "Your latest posts" or the correct page has been selected in the option "Posts page".


0

Create a blank page and name it panel then go to your created signup template and select parent page panel. Its just below Publish->Page Attributes. /*Add noindex to this page (Add to functions.php)*/ function add_noindex_tags(){ # Add noindex to page. if( is_page('panel') ) echo '<meta name="robots" content="noindex,nofollow">'; } ...


0

functions.php is processed way before you can know which page is being loaded. Instead of assigning value to variable put your code into function and use that function in page.php template. Why isn't is_page working when I put it in the functions.php file?


1

OK @Muyassir S. - we are missing some information to understand the problem. We basicly dont know if the "page" you are talking about is a category page, Your home page or a custom page - meaning: which file is being used to show that blog? here are two possible solutions. If we are talking about a category / page with slug: if(is_category('blog')) { ...


0

Double check you're using these functions correctly. Try collecting the results and output them in order to see what you're working with. get_the_ID() and get_queried_object_id() are two good ways to get the current ID, so pass them to get_post_status(). $debug = array ( 'get_the_ID' => get_the_ID(), 'get_the_ID_status' ...


2

Try this: if ( is_front_page() && is_home() ) { // Default homepage } elseif ( is_front_page() ) { // static homepage } elseif ( is_home() ) { // blog page } else { //everything else } Source: http://codex.wordpress.org/Conditional_Tags


3

I finally got it working, but not with the code in my question. I totally scrapped that whole idea and restarted going in a new direction. NOTE: If anyone are ever able to sort out the issues in my question, feel free to post an answer. Also, if you have any other solution, also feel free to post an answer. REWORKED CLASS AND SOLUTION: What I tried to do ...


-2

Since you're in the context of WordPress, you can utilize its redirect functionality. Like this ( in functions.php ): add_action( 'template_redirect', 'redirect_homepage' ); function redirect_homepage() { if( is_page(42) && current_user_can($capability)){//When Page 42 (ID) is being displayed, user have some capability wp_redirect( ...


2

If you want to redirect, a good event to use is template_redirect: add_action( 'template_redirect', 'my_page_template_redirect' ); function my_page_template_redirect() { // You can skip is_user_logged_in() if checking the user capability if( is_page( 1234 ) && ! current_user_can( 'do_something_special' ) ) { $redirect_to = ...


0

Make a new file and include a page template to structure the loop and display your bookmarks. <?php /** * Template Name: Bookmarked Page * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ Then just make sure a page exists called bookmarked (so the url is in place) and set it's template to the custom page ...


0

You need to modify the rewrite argument when you register your post type: $args = array( // [...] 'rewrite' => array( 'slug' => "Tours" ), ); register_post_type( mc_tours, $args );


0

The above helped a bit but I actually had to dig deeper into the code and found the page ID in the Body Class: body class="page page-id-4264



Top 50 recent answers are included