How to rewrite custom slugs that follow my rules
How to rewrite custom slugs that follow my rules
How to rewrite custom slugs that follow my rules
You should not be using the GUID as a link. If you want to get the URL for a WordPress post object you should use get_the_permalink(): href=”‘ . esc_url( get_the_permalink( $package_link ) ) . ‘” Note that I also escaped the URL.
You can try extracting the content of the first H1 tag from your post. function get_first_h1(){ //Get filtered content of post ob_start(); the_content(); $content = ob_get_clean(); //Define matching pattern: content of h1 tags $h1_pattern = “~<h1>(.*)</h1>~”; //Variable to hold results $header_matches = array(); //Search content for pattern preg_match( $h1_pattern, $content, $header_matches ); //First match will … Read more
Comments not working (error not allowed) on posts with custom post status
Custom post type Premalinks main page and details page
I was able to solve this by removing CPT UI plugin, registering the custom post type with: function create_post_type() { $args = array ( ‘public’ => true, ‘has_archive’ => true, ‘show_ui’ => true, ‘supports’ => array(‘revision’,’title’,’editor’,’author’, ‘thumbnail’, ‘custom-fields’), ‘taxonomies’ => array( ‘category’ ), ‘labels’ => array( ‘name’ => __( ‘work’ ), ‘singular_name’ => __( ‘work’ … Read more
Custom Gutenberg block problem – This block has encountered an error and cannot be previewed
Multiple custom post type in URL
Custom order of CPT posts by title, in wp-admin area by default
I’m not clear on whether you’re looking for one big query that returns all the ‘track_trip’ and ‘training’ posts, sorted by the two different custom meta fields, or two separate queries. But either way, you’ll need to use a custom meta_query. You will probably also need to orderby meta_value_datetime. Note in the “‘orderby’ with multiple … Read more