How to Change the path of a child page?

$mypages = get_pages( array( ‘parent’ => get_the_ID(), ‘sort_column’ => ‘ID’, ‘sort_order’ => ‘ASC’, ); foreach( $mypages as $page ) { // Modify this line to include ID of page where want to change the link if ($page->ID == $ID_OF_PAGE_THAT_SHOULD_BE_PDF_LINK) { // Modify this line to include your PDF link echo ‘<li><a href=”https://wordpress.stackexchange.com/questions/154920/YOUR_PDF_LINK_HERE”>’ . $page->post_title . … Read more

Loading internal page

If I understand correctly what you want, you want a ‘page in a page’. This is very easy. Just use this plugin. It has support for widgets and shortcodes. Especially the shortcodes will be interesting for you. The plugin description repeats that it’s mission is to bring your Facebook posts and Twitter feeds to your … Read more

1st Level Page with No Children

To expand upon my comment: Top-level page? (q.1) global $post; $x = get_ancestors( $post->ID, ‘page’ ); if( ! $x ) { // there are no ancestors, therefore this is a top-level page } Childless page? (q.2) global $post; $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘page’, ); $x = get_children( $args ); if( ! … Read more

Separate Editing from Publishing for pages

For your authors you need to set accounts with a “contributor” role. A contributor can writ content but can’t publish it. Then create a user for your editor and give him an “editor” role and he will be able to publish the content the authors had written. The main problem you may run into is … Read more

Cannot add media to a page

The TypeError: wp.Uploader is undefined error is coming, because wp media editor file is not included. Please check for this.

Widget & storing a Select box choice

Here’s the working answer for future reference. <p> <label for=”<?php echo $this->get_field_id(‘select’); ?>”><?php _e(‘Choose A Page:’, ‘check_avail_widget’); ?></label> <select name=”<?php echo $this->get_field_name(‘select’); ?>” id=”<?php echo $this->get_field_id(‘select’); ?>” class=”widefat”> <option value=”Select A Page”> <?php echo esc_attr( __(‘Select A Page’) ); ?> </option> <?php $pages = get_pages(); foreach ($pages as $page) { echo ‘<option value=”‘.get_page_link($page->ID).'” id=”‘ . … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)