You should mention register function in your Question.
Add flush_rewrite_rules( false ); in Your custom_post_type register function. it is necessary when you are creating custom post with archive.
example code:
function create_my_post_type(){
register_post_type('MyPost', array(
'labels' => array('name' =>__('My-custom-Post'),'singular_name' => __('my-post')),
'rewrite' => array('slug' => 'MyPost','with_front' => true),
'public'=>true,
'has_archive' => true,
));
flush_rewrite_rules(false); //recreate rewrite rules.
}
add_action('init','create_my_post_type');
Related Posts:
- Adding first / last CSS classes to menus
- WordPress Admin Bar pushed Sticky Footer off the bottom of the page
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- “wp_enqueue_style();” don’t load new edited style
- functions.php not adding css to website?
- if file_exists not working with wp_enqueue_style
- Want to create Child theme, but already edited Parent theme css files and some php files
- Using PHP to toggle stylesheet and header image, set in cookie
- Archive dropdown styling not applied
- Different background-image by category
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Put CSS inside a PHP file and include it the right way
- Missing sidebar parameter “fix” – before_content
- How Display Posts on category
- Slider loading issue
- Parent theme CSS overriding child CSS rules
- How to style options page in dashboard?
- Theme Options Page – User Updates Logo
- How to use my style.css file outside of wordpress subdomain?
- Dynamic Stylesheet loads but doesn’t finish
- How to add date to navigation bar
- Can I install/embed WordPress on a ‘single page’?
- Incorrect MIME type for assets with Valet
- Customize position of social icons in upme plugin [closed]
- Css loads very slow [closed]
- How create a Shortcode with hover and complex options
- WordPress Multiple Navigation bars
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- How do I add a custom css to all posts without affecting homepage css? [closed]
- WordPress style.css not updating, only after theme reload
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Automatically set all tags to have a height of 0 if there is no content inside the tag [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- Correct way to enqueue page specific CSS file
- Wrapping a Sidebar within
- Add Codepen animation as Preloader to WordPress
- Reduce size of responsive title
- Clickable image link sends people to wrong URL
- Creating a mobile site by adding a new class to the body tag from functions.php
- How to add drag and drop functionalities to a div inside option panel
- Removing WordPress Footer -without access to PHP code?
- CSS change in woo commerce Place Order Text [closed]
- Post repeated when opening in overlay, how do I solve this? [closed]
- Split site title and apply different classes
- Extend Menu Walker Output
- Dynamic CSS through PHP issue
- Assign Custom classes to every Excerpt
- How to make changes to style.php [closed]
- Adding a navigation page state to individual blog and portfolio pages
- Inline CSS header style priority function.php Child (no enqueing I think)
- How to put search bar & logo in the “primary navigation” storefront theme?
- Create Columns with Custom Walker and CSS Classes
- How to add a CSS class to this php code [closed]
- Why would the child theme load in the Customize preview, but not on the site itself?
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- echo cutom css code to WordPress page template file ? is this safe?
- Use CSS tag inside PHP code
- Warning: Use of undefined constant all – assumed ‘all’ (this will throw an Error in a future version of PHP) in C:\Users\…….. on line 6
- Trying to generate a CSS file in wordpress uploads folder
- WP Website is shown in HTML
- I cannot find the wordpress.scss file that my live site is pulling from
- I got big white screen when i attach main style sheet of Html in functions.php
- register dependency css and js inside a plugin class
- how to add functions to my function.php using a child theme?
- Replace header with large image on home page only, using Genesis child theme
- Add a default style if no Featured image is selected
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Styling a specific post after hovering over it
- Using Sprit-sheet on WordPress categories
- Add class for the_post_thumbnail_caption()
- How to include different html tags in the header for different pages?
- CSS loading as empty file in Custom Theme
- How limit the width of a fixed menu-bar on scroll?
- Font-Family does not looks like how it should be [closed]
- Where to find the html for WordPress site? [closed]
- How to add style in functions.php depending on conditions?
- How to remove image on single product and get product to span page?
- widget: input the px value from user and use it as inline style in widget function
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Hide button based on PHP result
- How to have Function of a plugin using global vars into a shortcode?
- Child theme not working properly
- How Can I Center the Logo in the Navigation Menu? [closed]
- Cant get theme to change footer color through theme customizer
- Changing 2011 theme header image based on user dropdown
- How to change the menu color
- How to change a specific character in a theme option value – replace a space with a plus sign
- How do I get Roboto Google Font to display normal font-style? [closed]
- Using PHP for background-image property [closed]
- How to create and add js and css file when server is not on my PC?
- which php or css file has generated an inline style in WordPress that overwrites my css
- Child-theme suddenly stopped working [closed]
- Custom HTML/CSS Theme into WordPress – SEO considerations
- WooCommerce Checkout Cart [closed]
- why css file not link?how to create permalink?
- Using Featured Image as Hero Background in Word Press
- Live Preview while customizing is not showing the updates while editing in WordPress
- Hide or Show Read More Button by Content Area