Password protected sites

The easier way can be have a group of users called teachers and give just the teacher’s group the permission to visit the page. There are many plugins for permission handling and grouping users so you’ll just need to search WordPress plugin repository. Just an example: groups plugin Another possible answer can be : multi … Read more

Adding a page summary to a specific page

You can use wp_list_pages with the child_of argument: /** * Display hierarchical list of all posts for a given post. * * @param int|WP_Post $post Display for post. Defaults to current post/page. */ function wpse_184554_list_section( $post = null ) { if ( ! $post = get_post( $post ) ) return; if ( $post->post_parent && $ancestors … Read more

Changing Post Sitemap Frequency to Hourly [closed]

As it is explained here ‘wpseo_sitemap_’ . $filter . ‘_change_freq’ the $filter should be replaced with post type that you want to change, you can replace it with: homepage, blogpage, $post_type . ‘_archive’, $post_type . ‘_single’, $c->taxonomy . ‘_term’, author_archive. while the $post_type variable based on WordPress Codex can be replaced with: Post (Post Type: … Read more

Disable parent in wp_list_pages – WordPress

You can use get_pages() instead and write some custom code like this : $args = array(‘exclude’ => ‘5’, ‘sort_column’ => ‘ID’ ) $pages = get_pages($args); foreach ( $pages as $page ) { echo $page->post_title; } You may of course elaborate more the code in order to obtain a tree. You may also check the source … Read more

Exclude a specific page from WordPress sitemap. (wp-sitemap.xml)

The code below does work, just make sure you are editing the correct themes function.php file! // Remove specific pages function gt_disable_sitemap_specific_page($args, $post_type) { if (‘page’ !== $post_type) return $args; $args[‘post__not_in’] = isset($args[‘post__not_in’]) ? $args[‘post__not_in’] : array(); $args[‘post__not_in’][] = 221; //locations $args[‘post__not_in’][] = 261; //blog return $args; } add_filter(‘wp_sitemaps_posts_query_args’, ‘gt_disable_sitemap_specific_page’, 10, 2);

Embed sitemap in a page

You can fetch all the different post_types you have by using get_post_types(). Then you can loop through all posts of each post_types and echo all these posts (title + link). That way you have the freedom of formatting your sitemap the way you want.

What is this error message?

If you already have the files sitemap.xml and (if you have gzip enabled in Simple Google Sitemap) sitemap.xml.gz in the root directory of your WordPress installation, try deleting them and create new empty files with the correct permissions for that plugin, then manually run the sitemap generator. If these files don’t exist, try creating the … Read more

Where is All in One SEO Pack sitemap.xml located?

The sitemap added by most of the plugins (such as Google sitemaps or YOAST SEO pack) is a virtual file added to your websites by the plugin. This file doesn’t physically exist, therefore modifying it is not an option for you. There might be 2 things that you can do about it, Either find the … Read more

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