Support » Plugin: Custom Content by Country (by iControlWP) » [Plugin: Custom Content by Country, from Worpit] IP-2-Nations and Theme issues

  • Resolved tammylewis



    I’m currently using the Ambleside theme and wanted to be able to change the logo on the top left depending on the country (we have the country name made into the USA logo) and I think this plugin will do what I need.

    The first issue I ran into was that IP-2-Nations wouldn’t install. When I clicked on the “The IP-2-Nations data needs to be updated/installed before you can use the Content By Country plugin.” link, it would start loading but not go anywhere (stuck on the link After a little bit of googling, I found that I could just restore the database manually, and did this without any problem, but the message at the top of the admin controls is still there. Have I missed something when installing or is there any way to make it realise that I have installed it?

    Secondly, the logo for the theme is done through a control panel for the theme. In the box provided for a custom title, I have entered “[CBC country=”us” show=”y”]<img src=”IMAGE-FOR-US” />[/CBC][CBC show=”y”]<img src=”IMAGE-FOR-ELSEWHERE” />[/CBC]”. I’m not sure if I’ve done the code right for a start. What I want to achieve is, if the user is detected as being in the US – it will show the US logo, but if they’re anywhere else, it will show the other logo. Regardless, the code is coming up as plain text (kind of) when I update the website. Is this because I’m working locally, or will I need to change something in the code to ensure that the code is being read as shortcode?

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Paul



    Thanks for writing very detailed questions… this helps a lot.

    1) I’d like to find out why the DB didn’t install in the first place. Do you have any error log files you could share with me? This might help solve a problem that I’m not aware of for your environment and for others.

    2) regardless, I can add an option to allow you to dismiss this dialogue in a future release. That shouldn’t be too much of an issue.

    3) The problem with your image, I think, is that you’re put the shortcode in a place where WordPress doesn’t actually process shortcodes. By default, I believe they’re only processed within posts/pages.

    What you’ll probably need to do is find the place in the WordPress theme you’re using that prints the logo IMG tag, and replace it with the WordPress code that actually processes shortcodes. Try something like:

    do_shortcode( '[CBC country="us" show="y"]<img src="IMAGE-FOR-US" />[/CBC][CBC show="y"]<img src="IMAGE-FOR-ELSEWHERE" />[/CBC]' );

    Give that a shot. The link below is more info on this function.

    I hope that helps. I actually just released a quick update to the plugin before I saw your post. Hopefully I’ll have a dismiss link sometime this week.


    Plugin Author Paul


    by the way… I added the dismiss button now, so hopefully you should be able to get rid of the message.

    Thanks for your quick & helpful reply! 🙂

    1. What type of logs would you be after? I’m hosting WordPress locally using XAMPP.

    2. I’ve updated the plugin and got the dismiss button, thanks!

    3. I thought this was the issue after reading the ‘not working in widgets’ post. I’ll try and find that bit of code, hopefully shouldn’t be too difficult to find.

    3. I think I’ve found where it needs to be and it doesn’t seem to break it, haha. I’m working locally at the moment so I can’t really test it properly.

    Plugin Author Paul


    For XAMPP, I believe the logs you’ll want are XAMPP-Folder/apache/logs

    That’s the default I believe. Take a little look in your error_log and php_error_log files and see if you can find any reference to the plugin. Anything you find would be helpful.

    Glad you got the dismiss button and it works as you need. Good luck with editing the theme too.. that can sometimes be tricky! 🙂

    If ya like the plugin and it does what ya need, would you mind giving it a 5* star rating on the repository? This helps lend some legitimacy to the plugin. I’d appreciate it! 🙂

    Thanks. If you have any questions, give me a shout again.

    Can’t seem to find anything referencing the plugin unfortunately. 🙁 Thanks a lot for your help, I’ve rated the plugin as 5* 😀

    Plugin Author Paul


    Cool, no problem. Thanks for checking for me, and many thanks for the stars! 😀

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Custom Content by Country, from Worpit] IP-2-Nations and Theme issues’ is closed to new replies.