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

create a template page for a post

You can add a rewrite tag and rules that capture anything after the post name: function wpd_add_rewrites(){ add_rewrite_tag( ‘%my_page%’, ‘(.+)’ ); $post_types = array( ‘movie’, ‘book’, ‘album’ ); foreach( $post_types as $post_type ){ add_rewrite_rule( ‘^’ . $post_type . ‘/([^/]*)/([^/]*)/?’, ‘index.php?post_type=” . $post_type . “&name=$matches[1]&my_page=$matches[2]’, ‘top’ ); } } add_action( ‘init’, ‘wpd_add_rewrites’ ); Don’t forget, you … Read more

Dashboard :10 Last draft page and 10 last pending review page (metabox)

#dahsboard BOXES #Last edited pages add_action( ‘wp_dashboard_setup’, ‘admin_dashboard_last_edits_register’ ); function admin_dashboard_last_edits_register() { wp_add_dashboard_widget( __FUNCTION__, __( ‘Last published pages ‘, ‘admin-dashboard-last-edits’ ), ‘admin_dashboard_last_edits_dashboard_widget’); } function admin_dashboard_last_edits_dashboard_widget() { $posts = get_posts( array ( ‘numberposts’ => 10, ‘post_type’ => array ( ‘page’ ), ‘orderby’ => ‘modified’) ); if ( $posts ) { $date_format = get_option( ‘date_format’ ); echo … Read more

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

View Private Published Page with URL Code (no login required)

You can actually hook the built-in page/post password feature and set it up to check for url params that match page/post password, and then change the value of $required to false. add_filter( ‘post_password_required’, ‘my_allow_url_param’, 10, 2 ); function my_allow_url_param( $required, $post ) { if ( empty( $post->post_password ) ) { $required = false; return $required; … 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.

Woocommerce featured image of page – not product

Thanks to you I tried this on my functions.php It worked, but also had to get the ID of the page, in my case 4. add_action( ‘woocommerce_before_main_content’, ‘woocommerce_category_image’, 2 ); function woocommerce_category_image() { if ( is_product_category() ){ global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_term_meta( $cat->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); if … Read more

Disable most recent & view all (TABS) on nav-menu.php

You can introduce a js file exclusively for admin panel doing this in functions.php: //Admin JS add_action(‘admin_init’, ‘custom_admin_js’); function custom_admin_js() { wp_register_script( ‘admin-js’, get_stylesheet_directory_uri() . ‘/js/admin.js’ ); wp_enqueue_script( ‘admin-js’ ); } And in admin.js file: jQuery(document).ready(function($) { $(‘*[data-type=”tabs-panel-posttype-page-most-recent”]’).fadeOut(); $(‘*[data-type=”page-all”]’).fadeOut(); $(‘*[data-type=”tabs-panel-posttype-page-search”]’).trigger(“click”); });