Problem with images URL after filter applying

<?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); // get sentences into array $sentences_count = count($sentences_array); // … Read more

Change permalinks for specific pages

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.

how to replace hostnames on certain external links?

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’, $content); } If the URLs you are looking to modify are being stored and output’d … Read more

DNS – Change WordPress Site Name?

You need to update all the places in the database that are using the original location. you can use the following tool to do so. There are others but I have found this one to be easy. Just remember to remove the files after you are done with it. I would run this in it’s … Read more

Protect get_query_var from manual input in url

When someone messes up an URL it’s typically not something to do anything about. If you look at any site’s log they receive tons of completely broken and malformed requests every day. You only have to care about one case — that URL parses properly and input data is valid and safe. Whenever request is … Read more

Dynamic URL and pass the data to an iframe

Step 1: Create a page with slug ‘profile’ in your WordPress Dashboard. Step 2 Use this function to register profileId var. add_filter(‘query_vars’, ‘wp233_query_vars’); function wp233_query_vars( $query_vars ){ $query_vars[] = ‘profileId’; return $query_vars; } And add a rewrite rule to wordpress like this: add_action( ‘init’, ‘wp233_add_rewrite_rules’ ); function wp233_add_rewrite_rules() { add_rewrite_rule( ‘^profile/([^/]+)?$’, ‘index.php?pagename=profile&profileId=$matches[1]’, ‘top’); } Step … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)