New answers tagged

0

You're using the reserved public query variable name as your custom one. It can e.g. affect the canonical redirect by setting page_id and name for a different page. Change it to something else to avoid possible name collision, like kenan_video_slug: add_rewrite_rule( '^watch/([^/]*)$', 'index.php?pagename=watch&kenan_video_slug=$matches[1]', ...


0

There are many reasons why WP could display this: 1 Insufficient file permissions on wp-admin folder (check this with ftp) 2 Prefix not consistently the same in database and wp-config (less likely in this case, but check anyway). 3 .htaccess doesn't reroute wp-admin folder correctly 4 User roles not well defined in database (wp_capabilities should ...


1

You should hook add_rewrite_rule() into init Assuming http://local/rieltplus/ is your homepage, and category/catalog/ is a category archives, this should work: add_action('init', function() { add_rewrite_rule( 'category/catalog/([^/]+)?$', ...


0

I ended up with this <?php //get children of page 241 and display with custom fields $args=array( 'post_parent' => 825, 'post_type' => 'page', ); $my_query = null; $my_query = new ...


1

If the links are coming from the main content areas, you could create a hook which acts against this "content" output. In your themes functions.php file, you could try something like: add_filter('the_content', 'the_url_filter_function_name', 30); function the_url_filter_function_name($content) { return str_replace('bad-url.com', 'good-url.com', ...


4

The Why Part If we have a page called technical and try to load: example.tld/technical/99999999999999999999 then the 99999999999999999999 part is treated as a page query variable with the value of 2147483647. The reason is this rewrite rule for pages: according to the handy Monkeyman Rewrite Analyzer by Jan Fabry. This part of the ...


0

I just examined your URL http://www.homecredit.ph/wp-content/uploads/home1/homecre1/public_html/files/News-26.jpg and code and noticed that, you are saving your image in http://www.homecredit.ph/files/News-26.jpg path but trying to access from upload directory of WordPress. /home1/homecre1/public_html/files/News-26.jpg - this is the path stored in database ...


1

The general implementation of such "pretty" permalinks in WordPress is realm of WP Rewrite. However it is pretty wide topic and low level code is a bit of abomination. I would say these are three most common techniques for it, complexity ascending: Use WordPress native data structures (such as Custom Post Types and/or Taxonomies) and benefit from ...


1

So i found a solution. 'with_front' => bool Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true 'rewrite' => array('slug' => 'uslugi-i-czenyi','with_front' => false), Hope helps somebody


1

Should work 'with_front' => false, 'with_front' => bool Should the permalink structure be prepended with the front base. (example: if your permalink structure is /blog/, then your links will be: false->/news/, true->/blog/news/). Defaults to true function uslugi_init() { $args = array( 'label' => 'Услуги', 'public' => true, 'show_ui' ...


3

Retrieve "type" of query from url: Previous suggestions As noted in the linked answer, there's url_to_postid(). This will just get you the ID of the object at that endpoint. Long story short, this function will only return an ID and then run a new \WP_Query to get the post type object from the DB and finally return the URl – if there is any and _if it is ...


1

You can make a custom template for a custom post type. Generally I use the single.php file and duplicate it. Then I rename it to single-{custom-post-type}.php as per Post Type Templates. In your case the template file should look like this single-uslugi.php. As far as saving the old URLs and fixing things I don't quite understand what you are looking for. ...


0

It's very difficult for someone here to tell you where to look as it could be anywhere. I suggest you download all your wordpress files on to your computer and then use a text editor to search those files for $_GET['i'] and $_REQUEST['i'] which will probably help you find where to start looking.


0

In very general sense this looks like an arbitrary GET query. WP uses these extensively in a raw form or (commonly) hidden under a layer of pretty permalinks. However i specifically doesn't seem to be any query variable name WordPress recognizes natively. Most likely it is something custom to the site (or maybe some extension installed). You will have to ...


0

It means that you have some url parameter loading from site, as reaction to some plugins, or file, or some changes, or behavior on site that may be loaded by some php code. In this scenario it can't be exactly seen where is it coming from, but it looks like starting some type of increment. But most important you can't just change the url site with added ...


1

You can only have one page at example.com so let's say you have an 'about' page: example.com/about In Wordpress Settings > Reading Settings you can select a static page to be the homepage, so example.com would now show the 'about' page. Now, go to Wordpress Settings > Permalinks and select Post name.


0

You can use a rewrite rule in your htaccess: /for-rent/turkey/istanbul RewriteRule ^for-rent/([^/]*)/([^/]*)$ yourpage.php?country=$1&city=$2 [L] Than in your yourpage.php: $country = $_REQUEST['country']; $city = $_REQUEST['city'];


0

This is usually a permalink issue. Go to your Wordpress dashboard then look for Settings>Permalinks. There will be radial selectable options. You can select any that have no mention of index.php. Alternative select Custom Structure then in the field to the right insert /%monthnum%/%day%/%year%/%postname%/ then save with the button at the bottom of the ...


1

Thanks to @Max Yudin this is an answer to my problem: function user_content_replace($content) { $sentences_per_paragraph = 3; // settings $pattern = '~(?<=[.?!…])\s+~'; // some punctuation and trailing space(s) $sentences_array = preg_split($pattern, $content, -1, PREG_SPLIT_NO_EMPTY); // get sentences into array $sentences_count = ...


0

<?php $string = 'Sentence 1. Sentence 2? Sentence 3! Sentence 4... Sentence 5… Sentence 6! Sentence 7. Sentence 8. Sentence 9… Sentence 10... Sentence 11. '; $sentences_per_paragraph = 3; // settings $pattern = '~(?<=[.?!…])\s+~'; // some punctuation and trailing space(s) $sentences_array = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY); // ...


-1

The easiest way to get the site url without any sub-directories ( http://example.com/ instead of http://example.com/blog ), just use the backslash / For example, if you type: <a href="/">domain url</a> It will create a link that goes to your domain


0

Posts have a slug (that's the last part of the URL), and it must be distinct, even if posts are in different categories. If your only worry is SEO, don't worry. Google sees the URLs as distinct, and Google is used to dealing with URLs that have a suffix on them, and has no problems with it. The keywords in the URL are still the same and have the same ...



Top 50 recent answers are included