Reputation: 31
My question is essentially the same as that asked here: display the content of a google sheet cell in a web page
Another question that is probably relevant is this one, though I don't think it relates to google spreadsheets: Embedding Google Apps Script WebApp in WordPress Page
My question though relates to displaying a single cell from a google spreadsheet at html in a wordpress page? Or does the method only work for google sites?
If its only google sites, any suggestions on alternative methods achieving this on a wordpress page?
Upvotes: 1
Views: 6175
Reputation: 1123
You can extract the value of a Google sheets cell using a specially constructed URL like this: https://sheets.googleapis.com/v4/spreadsheets/$google_spreadsheet_ID/values/$location?&key=$api_key
Where:
$api_key = Your API key
$google_spreadsheet_ID = Your spreadsheet ID
$location = The sheet name and cell name (or a named range).
The results are returned via json which you'll then have to parse. Here's a tutorial on how to do it in WordPress to get the value of just one cell:
https://www.wp-tweaks.com/display-a-single-cell-from-google-sheets-wordpress/
Upvotes: 1
Reputation: 3700
From the spreadsheet menu: File-> Publish to the web. Add the link to wordpress as a iframe.
Upvotes: 0
Reputation: 9
Yes, it is possible to display content from google spreadsheet in a wordpress site. You can use the PHP library for the Spreadsheets API. The library is part of the Zend framework - http://framework.zend.com/downloads/latest. Download the Zend_Gdata, install the library in your template folder. It is good idea to authenticate and make your api calls from a custom template page. Otherwise you have to use a plugin that executes php code. You can check this entry, too - Using Zend GData, How do i get a worksheet cell index by looking for its value? or here - Retrieve only specific columns of spreadsheet with zend gdata from gdocs, or Check the manual provided by Zend - http://framework.zend.com/manual/1.12/en/zend.gdata.spreadsheets.html
Upvotes: 1