How do i change page template in bulk?

Try something like this: $pages = get_posts(); $page_ids_to_swap_the_template = array( 1, 2, 3, etc… ); foreach ( $pages as $page ) { if ( in_array( $page->ID, $page_ids_to_swap_the_template ) ) { update_post_meta( $page->ID, ‘_wp_page_template’, ‘new_template.php’ ); } }

Send mail from page using wp_mail

This can (and should) be achieved using the admin_post action. Take a look at the docs for an example: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_post_(action) SitePoint also have a more comprehensive tutorial here: https://www.sitepoint.com/handling-post-requests-the-wordpress-way/ Hope that helps.

remove/hide pages from users backend

One way to achieve this is by looping through the parent pages and fetching their respective children pages ids. The resulting arrays can then be merged and used in the ‘post__not_in’ variable. add_filter( ‘parse_query’ , ‘exclude_pages_from_admin’ ); function exclude_pages_from_admin( $query ) { global $pagenow,$post_type; $pages = array(‘1′,’2′,’3’); foreach ( $pages as $parent_page ) { $args … Read more

creating and styling a within a page

You could create a styled section/div in your page/post content by using WP shortcode. if you could manage a time then you could create your custom shortcode with your requirement. But if not then you could select available plugins here: Shortcode Plugins

Proper way to implement/access a built-in page in my theme

I am assuming the following setup from reading your question: site.network.com site-2.network.com site-3.network.com where the main site exists on network.com (i.e. blog id 1). All sites (or at least all subdomain sites) share the same theme. You need to be able to create a single content page and have that content available on all sites, … Read more

Add a predefined page to site

The best option for you likely is to create a page template. This will allow you to put your code in a php file (the template) and add footer and header information to that page. You then assign this file to a page within wordpress. That ties your new code into wordpress. You still have … Read more

Password Protected Page Title

You don’t want to translate the title, so there’s no need to use __() here and you won’t translate ‘%s’, because that’s a placeholder. add_filter( ‘protected_title_format’, ‘remove_protected_text’ ); function remove_protected_text() { return ‘%s’; } should work.

How get get list of pages in ajax search

There is no get_pages() method in the WP_Query class (for WordPress version 4.9.4). So in the data_fetch() function, replace the following: if( $the_query->get_pages() ) : while( $the_query->get_pages() ): $the_query->get_pages(); ?> ..with this: if( $the_query->have_posts() ) : while( $the_query->have_posts() ): $the_query->the_post(); ?> And in the fetch() JS function, set the type to POST, like so: function … Read more

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