0

I'm really just looking for ideas and guidance while foraging for memory processing in the WordPress CMS Divi Structure.

My company is in need of a good ContentPlaceholder solution. True to the MVC thinking we need to minimize the creation of redundant resources and yet create a national website that serves the regional concerns of different states. We are thinking of using geolocation (Google reverse lookup) but it has to allow standard users to add/manage the state dependant content blocks in WP.

CodeCanyon has a user role content placeholder plugin https://codecanyon.net/item/wordpress-content-placeholders/9259679

There is a service like https://geolify.com/

There is alot of discussion out there on using .htaccess URL rewriting or RewriteCondition. Perhaps something like URL.com/page?state_=TX

Maybe a custom PHP function could just pull the URL state value but I need to dig on PHP functionality within WP (with or without a custom plugin).

get_header();

get_footer();



> <?php $matches = Array();
> preg_match("/^\/questions/([0-9]+)\/([^\/]+)$/",
> $_SERVER['REQUEST_URI'], $matches);
> 
> $db = new Database(); $seo_title = $db->getTitleById( $matches[1] );
> if( $seo_title != $matches[2] ) {   header( "Location:
> /questions/{$matches[1]}/{$seo_title}", TRUE, 301 );   exit(); } else
> {   display_the_page(); }

Another example:

RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(US|CA)$ RewriteRule ^(.*)$ http://www.example.com/USA/$1 [L]

Or this example: https://stackoverflow.com/questions/20994880/ip-geo-location-with-mod-rewrite-php

1 Answer 1

0

Think I found my own answer, at least for now A WP Plugin! https://geotargetingwp.com/

Also we can look up more info regarding Maxmind or Ip2Location databases

Making our own plugin doesn't work for part time I'm already working on one!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.