I have a travel guide website which I am developing with WordPress which contains destination guides. On the destination guides pages I have a sidebar which displays destination statistics (currency, time zone etc).
I have to create a new sidebar for each page each time changing these values. Is it possible to create a MySQL database with these values and then insert some PHP code that will identify what country page is loaded and insert the corresponding values so that I can use a single sidebar for all pages.
I am fairly proficient with html/css but my understanding of PHP is limited. Any advice as to how this is best achieved would be greatly appreciated.
Why don't you simply use custom fields? They're any arbitrary pieces of data that you can associate with any post/page. So you could have a key my_site_currency (make sure they're easily distinguishable and unique), and each guide page would have a different value for that key.
WordPress provides a basic interface to manage them, but if you want a nicer UI (i.e. a separate metabox for just your values on just the guide pages in the admin) then you might want to check out the Advanced Custom Fields plugin.
Related
I am new to wordpress coding and need some help regarding fetching some data from different database which is not wordpress database and show on wordpress website. Let me make it more clear,
I have two CMS installed
1. WordPress
2. CRM
In CRM I have some user data which i want to display on wordpress. I searched web but almost each answer is showing retrieving data from wordpress database itself. If you have any way to do it please suggest.
There isn't an "as is" solution, every database structure of every CRM is different.
You will have to create your own custom database queries, and output the data into variables that you can use to create new queries on the other database.
Next, you will want to format your data and present it into a page.
what i understand from your post is thatyou want to show contents of a different database in your wordpress site. i think i have a solution which is not so good but it should work.
you can create a custom plugin for your wordpress. sole purpose of that plugin would be fetching data form that db and show it in you wp site.
make a custom connection in your plugin to connect it with the database you want.
After providing an event calender with PHP/MySQL/HTML/CSS I want to use Wordpress for that project from now on. Account and data management will remain outside of wordpress scope.
My best idea so far is to populate the posts (or pages) entirely from the already existing db. The URLs would be created by apache's rewrite engine.
To use one post and populate just the content would lead to really bad SEO.
So I want to create (virtually) unique posts populated entirely from the db. Extensive research on that topic brought up nothing usable so far. Maybe someone could point me in the right direction?
Preferences:
using mod rewrite to create the pages urls from event /ID/title rather than using the timestamps to create posts
keeping the data editable via external admin panel (no copying into WP-DB)
head data of post / page must be populated from db, e.g. title, author, timestamp etc.
Suggestions would be much appreciated, thanks in advance.
Have you tried the plugin WP All import. It creates unique post such are car listing etc based on the external DB. I also allows you to style and format your post.
https://wordpress.org/plugins/wp-all-import/
I am developing a WordPress site for a client and they would like me to setup a custom page that allows logged in users to query a custom table in the WordPress database. I'll be naming the custom table 'inspectors' and will import the data from a CSV file.
I've found this helpful tutorial on doing this
But the 'fly in the ointment' is that they want the results to be displayed according to location - so the user would enter a postal code or town and will get results for inspectors that are located within a 50 k radius. I'm pretty sure I could manage a basic query to the custom table, but getting it to return location-based results is beyond me.
Is it even possible - and if so, is it worth the time and effort it would take to make it happen - or is there a simple solution I just don't know about?
Also, they also would like me to create a custom form (that is available only to the admin user role) so they can update the info from WordPress and not have to update the info in the spreadsheet. They'd like to be able to export the data in the table to CSV easily too ...
Thanks for any help on this!
Refer the below link and write your own custom queries.
http://codex.wordpress.org/Class_Reference/wpdb
I am a long time Wordpress user looking to use the tool as a CMS to generate a website which will have individual posts about hundreds of specs on products that I have stored in a backend MySQL table. Is there a plugin or a tool that will help me auto generate these posts? For each post, I would like it to have the same format of title (one column) so that the URL will look like: http://www.domain.com/product1specs etc. Each post will contain a description (another column) and show a graph (data stored in another column).
Or do I even need to create posts? Is there a way to do this dynamically? So if someone goes to www.domain.com/product1 than it will automatically look in the database to find out what it should display for product1?
I believe there are other ways to do this with an PHP framework such as Code Igniter but I would like to stick with Wordpress because I am familiar with it and have other Wordpress plugins/themes I would like to leverage.
Any tips would be greatly appreciated!
I don't know of a plugin but take a look at this answer which basically required the same thing:
How to migrate from Yii to Woocommerce Wp, Still keep to old database (table,rows)
I need to create a wp widget that automatically pulls data from another wordpress install on a remote server.
Basically, the source site is a review site where offers vary over time. My widget will pull certain offers and make sure they stay updated.
Reviews on the source site are custom post types with custom meta fields that need to be fetched (price, offer, etc).
Looking around I've seen different suggestions: query the remote db, fetch the feed (does it store custom meta fields?), use json (which I barely know what is, but I am willing to learn new stuff).
What is the best method for my purpose and where can I find resources to help me achieving my goal?
Thanks for your help!
WordPress allows you to have an RSS feed per custom post type which is handy. Then you can make use of the WordPress Fetch Feed function to scoop what you need!
Are you the creator of the remote website?
You can create a new template in your theme
Code what you want to display in the format you want to display it
(json or just a bit of html)
In your wordpress admin create a new page and assign the new template
to it.
In your new site you just have to fetch the page