New answers tagged

0

This points to an issue with .htaccess. Going to Settings->Permalinks will recreate .htaccess, and so I think that it could be an issue with file permissions during your load or maybe because it's a dot file the server could be treating the file differently and somehow deleting it? This maybe useful : I have a routine that runs flush_rewrite_rules(true) ...


0

Thanks For your Comment you need to change some part of your code The way is not quite right but it works in directory wp-content/themes/your-theme crate a php file and set name page-thanks.php And put your code in this file For simple : <?php /** * Template Name: thank you page * */ get_header(); YOUR CODE ...


0

Why not use WordPress plugins? Try the following plugins : Gravity Forms Contact Form 7 and contact Form 7 Thank You I hope I helped


0

you should install "URL Rewrite" module and restart the server not only iis service. then reconfigure "Permalink Settings".


0

Seems like one of your ACF fields contain a <a> tag in them. In HTML you cannot have and <a> tag inside another <a> tag. Check the ACF fields the_field('feature_item_title') and the_field('hero_subtitle'), check their content, most likely you will find a <a> tag in one of them, remove it and your html will be structured correctly


1

Looks like it might be your WPML. See here: https://wpml.org/forums/topic/wpml-add-rewritebase-en-in-htaccess/ For posterity, the summary of this page is as follows: Problem: Some wrong settings caused an issue with "Use directory for default language". A 500 error was showing. Solution: The client reports here that pressing the 'Reset Settings' ...


0

OK so after much working out what was causing this, this was caused by me not setting: fastcgi_param PATH_INFO Which was being set as part of the hosting setup the company I work for sets. We found this out by tracing back the cause to the class_wp.php file in particular we found that: if ( empty( $requested_path ) || $requested_file == $self || strpos( $...


2

Is there anything built into the WordPress core to enable me to get the relative path from the “permalink structure” option No, because it isn't necessary, PHP provides this via parse_url. Using php -a we can launch an interactive PHP shell and test the code: php > echo parse_url( 'http://example.com/iamapost/100', PHP_URL_PATH ); /iamapost/100 php > ...


0

I am using follow code. It's check if current file has changed, then flush rewrite rules. add_action('init', function() { $md5 = md5_file(__FILE__); if (get_option(__FILE__) !== $md5) { update_option(__FILE__, $md5); flush_rewrite_rules(); } });


0

Probably the easiest way to solve this would be to add classes to your body tag based on the value of the parameter. You would just want to be sure to sanitize it. You can add classes to the body using the body_class filter which feeds in all the current classes as an array. You might try something like the following at the top of your template file: ...


0

Short Answer: You are wasting time - you won't be able to increase security. Read excellent answer: https://wordpress.stackexchange.com/a/198441/33667


0

This is happening because the_category() outputs a list of categories, with links. So it's outputting its own <a> tags, and you cannot put <a> tags inside other <a> tags. It's not valid HTML. What you're seeing is the browser's attempt to produce valid HTML based on invalid markup. HTML is very resilient, and invalid markup will not cause ...


-1

if you use get_permalink() then you need to user echo and the_permalink() you did not use to echo. <?php the_permalink(); ?> <?php echo get_permalink(); ?> code:- <div class="carousel-cell" data-flickity-bg-lazyload="<?php the_field('banner_afbeelding'); ?>"> <a href="<?php the_permalink();?>&...


0

FEV 2020 Since Jan Fabry anwser, the Wordpress function changed a little bit, so, the correct snippet to version 5.6 is: add_filter( 'sanitize_title', 'wpse5029_sanitize_title_with_dashes', 10, 3 ); function wpse5029_sanitize_title_with_dashes($title, $raw_title, $context = 'display') { $title = strip_tags( $raw_title ); // Preserve escaped octets. ...


0

There are three issues in your code: In your custom wp_attachment_link() function, you should use the post slug ($attachment->post_name) instead of simply replacing the (whitespaces) with - (dash) in the post title — and note that the resulting slug could be different than the actual slug, e.g. the title could be My Image with the actual slug being my-...


0

That is actually the expected output of next_posts_link(), i.e. it always uses the current page URL. And the same also applies to previous_posts_link(). So if you're on the homepage (localhost/), then the URL of page 2 would be localhost/page/2, and if you're on (your custom post type archive page at) localhost/todo, then the URL of page 2 would be localhost/...


-1

hi here is the solution if you are asking about custom url. go to pages and edit page ( note that download classic editor first) you can easily create a custom permalink with a classic editor. once you download a classic editor in your WordPress then it is so easy to create custom url for your pages. you can just try it. if your problem did not solve then ...


0

@ederico-dondi On your tag listing page, Wordpress is getting the content of the page from your url querystring. In your case, there is "tag" in your url so it will understand that you are on tag page. If you will remove tag then it will not show data of tag. for example. the below code will remove tag from your url. function customremovetag( $...


0

I have finally figured out the root cause of why I was getting the invalid JSON response and why permalinks had to be set to include index.php in all urls. My Apache configuration file was not allowing overrides and I think that means Wordpress was unable to alter files in my directory. The setting for my directory was: <Directory /var/www/> ...


0

The error was generated by the Elementor plugin. Setting 'Landing Pages' on Inactive in the Experiments menu in the Elementor settings did the job.


2

The process to do this isn't probably as complex as you think. Leave the existing page exactly as-is. Don't change its slug etc. Create a new page draft Create the new page content as you'd like it to have. Once the new page is complete, and ready to go, go back to the original page and change its slug to anything else. (see below gif #1) Go to the new page,...


Top 50 recent answers are included