Using a .pdf file as a page in wordpress

just upload it through ftp or your domain hosting panel to your public_html (www) directory. It will be there as a link to www.example.com/myfile.pdf. The case may be that if you have wordpress and installed any security plugins you’ll have to allow the exception within that plugin as well.

Custom rewrite rule not working

Hope this will work out for as it did for me. add_filter(‘rewrite_rules_array’, ‘insert_custom_rules’); add_filter(‘query_vars’, ‘insert_custom_vars’); function insert_custom_vars($vars){ $vars[] = ‘main_page’; return $vars; } function insert_custom_rules($rules) { $newrules = array(); $newrules=array( ‘page-name/(.+)/?’ => ‘index.php?pagename=page-name&main_page=$matches[1]’ ); return $newrules + $rules; } So, with the help of get_query_var() function, we can get value from url and use accordingly. … Read more

How would I get WordPress to parse /mypage/area/value as /mypage/?area=value?

add_rewrite_rule is very handy for this use, first add your custom rule for this: add_action(‘init’, function(){ return add_rewrite_rule( ‘([^/]+)/area/([^/]+)/?$’, ‘index.php?pagename=$matches[1]&area=$matches[2]’, ‘top’ ); }); and you already registered the custom query variable, next is (because you’re in development) go to admin > settings > permalinks and save settings to flush the rewrite rules. Now to get … Read more