GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress question: How to use custom field outside of wordpress but same domain (https://gfy.com/showthread.php?t=1100467)

tonyparra 02-19-2013 05:55 PM

Wordpress question: How to use custom field outside of wordpress but same domain
 
I have a domain that has wordpress running on the site but i use another script also, that is completely not wordpress and i would like to call wordpress custom fields in this script, anyone know how to do this?

For example wordpress controls sitea.com and the other script can make a page like sitea.com/page but its not a wordpress page :helpme if you understand or if you can help...

EddyTheDog 02-19-2013 06:01 PM

There is nothing stopping you pulling data from the mySQL DB that WP is using.

Its one of those easy if you know how to it problems....

fris 02-19-2013 08:46 PM

2 methods.

1. connect to the sql db and grab the info you want.
2. use xmlrpc and get the info that way.

Colmike9 02-19-2013 08:52 PM

Quote:

Originally Posted by fris (Post 19489952)
2 methods.

1. connect to the sql db and grab the info you want.
2. use xmlrpc and get the info that way.

:thumbsup

I'd go with #2, though.

fris 02-19-2013 08:53 PM

Quote:

Originally Posted by Colmike7 (Post 19489957)
:thumbsup

I'd go with #2, though.

ya

here is a quick example i put together just now

http://labs.fris.net/xmlrpc/

just gets 1 post but can do anythign with xmlrpc

EddyTheDog 02-19-2013 11:11 PM

Also you can use the REST API - It might be easier to learn and returns results in JSON.

http://developer.wordpress.com/docs/api/

just a punk 02-20-2013 12:14 AM

Quote:

Originally Posted by tonyparra (Post 19489716)
I have a domain that has wordpress running on the site but i use another script also, that is completely not wordpress and i would like to call wordpress custom fields in this script, anyone know how to do this?

For example wordpress controls sitea.com and the other script can make a page like sitea.com/page but its not a wordpress page :helpme if you understand or if you can help...

Here is a third solution. As far as I know, you are a CyberSEO customer. In such a case you can get the custom field values for any post you want via simple RSS feed using the following URL variable:

custom_tags=custom_field_name1[,custom_field_name1,...]

For example, let's consider that you have a blog at http://www.yourblog.com/ and want to get values of the "thumb" and "views" custom fields. You can do it like this:

http://www.yourblog.com/feed/?custom_tags=thumb,views

The requested values will be included into every feed item as simple XML tags, e.g.:

<item>
...
<thumb><![CDATA[http://i2.cdn.turner.com/cnn/dam/assets/130217175755-37-danica-video-tease.jpg]]></thumb>
<views><![CDATA[14]]></views>
...
</item>

tonyparra 02-20-2013 12:18 AM

Quote:

Originally Posted by fris (Post 19489959)
ya

here is a quick example i put together just now

http://labs.fris.net/xmlrpc/

just gets 1 post but can do anythign with xmlrpc

havent used this before, have to look it up..or is there a quick tut i can look at?

tonyparra 02-20-2013 12:24 AM

Quote:

Originally Posted by CyberSEO (Post 19490152)
Here is a third solution. As far as I know, you are a CyberSEO customer. In such a case you can get the custom field values for any post you want via simple RSS feed using the following URL variable:

custom_tags=custom_field_name1[,custom_field_name1,...]

For example, let's consider that you have a blog at http://www.yourblog.com/ and want to get values of the "thumb" and "views" custom fields. You can do it like this:

http://www.yourblog.com/feed/?custom_tags=thumb,views

The requested values will be included into every feed item as simple XML tags, e.g.:

<item>
...
<thumb><![CDATA[http://i2.cdn.turner.com/cnn/dam/assets/130217175755-37-danica-video-tease.jpg]]></thumb>
<views><![CDATA[14]]></views>
...
</item>

did not consider this one...might be the easy way out :)


All times are GMT -7. The time now is 04:21 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123