Hot answers tagged

3

Yes. Then it works. Add a new post and see if it changes. You can submit your sitemap to search engines but they will eventually pick it up regardless. Just give it time to see results -- it's not instant. Use Google Console https://www.google.com/webmasters/tools/sitemap-list to make sure it's getting picked up.


3

Go to Admin > Settings > Permalinks and click save without altering anything "Sometimes resetting the permalink structure will quickly solve a 404 error from a recent change to your installation." See http://kb.yoast.com/article/77-my-sitemap-index-is-giving-a-404-error-what-should-i-do for further details


3

Fist error I see is a syntax error: depth => 0 should be "depth" => 0 Second error is that you are using a category object like a post object. None of these lines will work: There is no post data to setup. Remove this line: setup_postdata($category); A category object has no category_modified property. Maybe you need the date of the last ...


3

WordPress multisite subdomains or suddirectories? I'm not sure if you're getting the two confused. Multisite subdomains are basically fake subdomains that simply have a CNAME or A-Name record added in the DNS records. That said, and I believe one responder said this, you just need a sitemap for the root domain, and then you'll have a robots.txt that ...


2

The reason of why Google doesn't index paginated comments is because of an issue with the canonical URL in your header. You can learn more about the reason behind this in a comprehensive question that I posted earlier. There is an excellent solution posted there for paginated post pages. Now, for Google to index comment pagination, bungeshea posted an ...


2

In order to be indexed by google news you need a unique permalink structure containing a unique number. You seem to have a permalink structure of %postname% that doesn't contain a number. You could change your permalinks for example to %post_id%/%postname% or %post_id%-%postname% in order to comply with google news requirements.


2

this may be called as a bug in get_permalink, but it may not be. I had the same case, and when I tried to echo site_url(); I get the https://... But once I updated the options for siteurl and home to have https get_option( 'siteurl' ); get_option( 'home' ); get_permalink worked fine. I noticed that on multisite.


2

The following code works right off the bat. Your sitemap will show up on: https://your-website-name.com/sitemap.xml Every time you create or update a page, post or custom post type it will show. Make sure to add the name of your custom post type: add_action( 'publish_post', 'ow_create_sitemap' ); add_action( 'publish_page', 'ow_create_sitemap' ); ...


2

WP Realtime Sitemap includes the menu items in the sitemap.


2

If you are using functions.php script to register custom post type, you should declare false to 'has_archive' => true,. function custom_post_type() { $labels = array( ... ); $args = array( // you have to set it to False. 'has_archive' => false, ); register_post_type( 'post_type', $args ); } add_action( 'init', 'custom_post_type', 0 ...


2

What I wanted to say in my previous comment: This hook is only fired when the sitemap is being built. After that, it's cached and always served from cache. That means you'll never see any change on the frontend because it's all cached. To disable the cache you can use the following code during development: add_filter( '...


2

Keep in mind there's really only a few actual pages in WordPress. Most URLs are getting redirected to index.php, parsed for the request information, and then processed accordingly. They are mostly posts in the end, which are pulled from the database and displayed according to one or more template files. The reason that's important is because it means you ...


2

It's because you're skewing the parent container with CSS transforms. You can see in this screen capture of developer tools that the parent cuts off the content on the second row. Try this: .menu-primary-menu-container{margin-right:10px;} You'll see that fixes it, so you just play around with those settings and get it exactly how you want it. Here's what ...


1

Short answer: No, it does not have any impact at all. Longer answer: The 'Order' field is a remnant from the early days of WordPress. Its only purpose is to order the pages in the admin for easier content management. Plus, people can use it to display a list of pages in their preferred order, for example in the main navigation. Nowadays custom nav menus ...


1

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 code of ...


1

You have to slightly modify your query on your above code as: $postsForSitemap = get_posts( array( 'numberposts' => -1, 'orderby' => 'rand', 'post_type' => array( 'page' ), 'post_parent' => 0, 'order' => 'DESC' ) ); if you want all page without parent as you have used to get parent ...


1

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 php file that is generating the XML and modify it, or maybe add a ...


1

hm.. isn't you suppose to run find command in other way? sudo find / -iname sitemap* note for / <- that stands for root directory. P.S. Isn't there easier just to check web root of your website for this file?


1

This question has been asked a long time ago, but the answer is kind of simple: Go to SEO --> Search Appearance. Select tab Contenttypes. Scroll down, here you can display or hide custom post types and archives from the sitemap.xml file. Hope that helps for someone.


1

Well, that message is pretty self explanatory. There is no sitemap linked in your robots.txt file. So you check if you have a sitemap (if not install a plugin that will generate one for you) and add this line to your robots.txt file in the root of your site: Sitemap: http://www.example.com/sitemap.xml


1

Difference between Site Root and WordPress Root It's important to differentiate between both variants. The Root of your Domain/Website depends on the settings of your webhost. Some might give you ftp access to directories above the web root, and some might put you directly in the web root when accessing your ftp data. When you upload a file for testing, and ...


1

The root of your site is where the wp-admin, wp-content and wp-includes folder is. From what you are showing in the image this does not appear to be the actual root directory of your Wordpress installation. You could make this easier with the plugin mentioned by the other answer but if you are looking for something more custom then you'll need to find the ...


1

WordPress is set up in a way that mostly ignores existing files. If what you want is literally upload fixed sitemap.xml file you can just do that and upload it to the root of your site (using FTP, hosting control panel, or whatever). WordPress will just ignore it and it will be available at example.com/sitemap.xml as anything else would be. Of course it won'...


1

You should call wp_nav_menu() in your footer.php template. It's used as following : <?php wp_nav_menu( array('theme_location'=>'footer') ); ?> The theme_location parameters refers to the checkboxes below the menu editor (Theme location). If your theme doesn't have enough theme_location, you can add some by adding function register_html5_menu(){ ...


1

Normally, if there's a WordPress file on disk, that'll be served first directly by Apache or Nginx, before WordPress gets involved. This is done in your virtualhost config, e.g. in Nginx you'll typically find the following, which tells it to try actual files first before letting index.php handle the URL and generate a page on demand. location / { ...


1

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:...


1

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 && $...


1

I think the better solution would be to create a custom page template for showing content to logged in users only and use that template to all password protected pages. Then you can create a single user for teachers/staff members so they can log in and view content. This way they will only have to login once on website to view several pages. Even they don't ...


1

You're looking for breadcrumbs, not a site map. There are plenty of plugins in the WordPress repository that might suit your purpose: breadcrumbs plugins.


1

You are most probably exceeding the maximum execution time when trying to retrieve 7000 posts/products, or specifically more than 2000 posts/products. To be quite honest with you, 7000 posts/products (or even just a list of posts/products) all packed in one single page is not only going to drive you crazy, but anyone visiting your site. I can imagine how ...


Only top voted, non community-wiki answers of a minimum length are eligible