Remove a link from a page ID used within an array [closed]

I have updated your code please try this and let me know if any query <div class=”row”> <?php $pages = array(54,55,56,57,58,74,75,76,77,78); $i = 1; foreach ($pages as $page) { $post_data = get_post( $page ); //print_r($post_data); $title = $post_data->post_title; $content = $post_data->post_content; $string = substr($content, 0, 0); $themeta = get_post_meta($page,true); $metalink = $themeta[0]; if (has_post_thumbnail($page) ): … Read more

Custom permalink not working and showing 404 page not error

I had the same technical need as you, and I have did this(code below) to get it work : function my_custom_rewrite_tag() { add_rewrite_tag(‘%xxx%’, ‘([^&]+)’); //change the regex to your needs add_rewrite_tag(‘%yyy%’, ‘([^&]+)’); //change the regex to your needs } add_action(‘init’, ‘my_custom_rewrite_tag’, 10, 0); function my_custom_rewrite_rule() { add_rewrite_rule(‘^tour/([^/]*)/([^/]*)/?’,’index.php?pagename=tour&xxx=$matches[1]&yyy=$matches[2]’,’top’); } add_action(‘init’, ‘my_custom_rewrite_rule’, 10, 0); Finally, do not … Read more

Custom post type slug 404

You are missing with_front in rewrite which is true by default. Change it to something like this ‘rewrite’ => array( ‘slug’ => ‘apps’, ‘with_front’ => false, ) See the docs 💡 Bonus tip: You should avoid using flush_rewrite_rules() there, it’s quite heavy and affects performance. You should ONLY use it when modifying rewrite_rules outside of … Read more

Permalink sub-routing catch-all

You can add an internal rewrite so WordPress recognizes these requests. In the same function hooked to init where you add the post type, you can add: add_rewrite_tag( ‘%tutorial_fragment%’, ‘([^/]+)’ ); add_rewrite_rule( ‘tutorial/([^/]+)/([^/]+)/?$’, ‘index.php?tutorial=$matches[1]&tutorial_fragment=$matches[2]’, ‘top’ ); The value is available via the WP API after the request is parsed: $value = get_query_var( ‘tutorial_fragment’ ); After … Read more

404 on internal pages, in all sites in my local server

This can be related to your overall Apache configuration and have nothing to do with WordPress itself. By default, Apache will not load any custom .htaccess files, you need to set AllowOverride for the given directory like so <Directory /path/to/site> AllowOverride FileInfo # etc </Directory> FileInfo should suffice, if not, try All and check the … Read more

Redirect From Url To Url

The easiest way to do is by using Redirection plugin. Follow these steps: Install and activate the plugin. Head to Tools > Redirection. Enter your Source URL (example.com/car/cadillac/image/) and Target URL (http: example.com/car/cadillac/). Finally, click on “Add Redirection” button.