I am trying to show wordpress posts outside of the wordpress framework. I have access to the wordpress database and am able to retrieve posts from the wp_post table, but the HTML in the post_content column isn't the same as in the actual blog. For example, if I have an image caption, it shows up in the post_content column as
[caption id="attachment_23" align="aligncenter" width="218"]Caption test[/caption]
Is there any way that I can render the database HTML so that it shows up the same as on the actual blog. I am not worried about styling and would actually prefer it if the HTML isn't styled at all.
Please help as much as you can.
You should use the XML-RPC API: http://codex.wordpress.org/XML-RPC_Support instead of accessing directly the database.
It will be easier to render the posts.
This is an ugly solution, but if you have WordPress installed but don't want to use in the traditional way, for whatever reason, you can use wp_load.php. Just do require_once(PATH_TO_WORDPRESS/wp_load.php), then you'll have access to all the WordPress features, including The Loop.
Related
I have a plugin that creates plugin specific database table rows that then are turned into pages. I have got this work with URL redirect and have been able to lay out the page. Now I am having some problems.
Problems:
Creating header title for the page. It currently shows page not found.
Creating description for meta SEO. Meta description is currently blank.
Showing these custom created pages to be added in WP menu.
I know these are not pages, and I have lost most of the wp functionality by doing this and not using custom post types but one of the main requirements of the clients was that the database have separate tables for their data.
I need some help or reference regarding these problems. Links for examples and articles would do or any free plugins that actually do this.
I'd really appreciate the help.
As you mentioned your self, using your current technique you will not able to take advantage of WordPress in real sense. You may use custom posts and then use wp cron to copy get the data from there to your own table.
First thing first, i'm new with WP and i'm also not very good with PHP.
anyway, i use this plugin http://wordpress.org/plugins/posts-in-page/ to group all the posts that i create inside a specific page and it works good.
Now, i'd like to change the code so that all my posts displayed on the page are not excerpt but the full posts.
I need a full explanation on how to do that cause as i said above i'm new both in wordpress and PHP.
thanks a lot.
There are two ways of doing this. One is to go to the Reading Settings in the Administration interface and select your desired option under For each article in a feed, show….
The other way is to hardcode this in the theme itself. Open the template file (index.php for example) and replace the_content or the_excerpt with the_content.
I am new to using Wordpress as a developer as opposed to just using the dashbord but am struggling to understand a few things and would really appreciate some help.
For a site that does not require a blog - do you just create custom/specific page templates for each page that your site requires?
If so - presumably you code the content directly. But then how does the client edit their website's about page or any other page for example - because doing it through the dashboard isn't going to use the necessary CSS hooks without using classes, id's and HTML?
As a beginner to Wordpress - I can't see that posts are used on sites that don't have a blog, but am I correct or is using posts the way a client can edit content on their site, but just have posts styled to look like normal content?
Or am I wrong in thinking a company (I am starting as an intern at a web dev company that use WordPress) provides the tools or at least configures WordPress to enable the client to change content?
Any help getting me to understand the basic concept and way a developer would create a custom WordPress site would be much appreciated. Thanks in advance.
You can use page.php. In WordPress everyone create at least one custom template type to get wider design for custom pages.
You can refer here for more info.
Use Advanced Custom Fields with page templates. Say you are making an About page, call that template about and select that template in the backend editor. Once you save the page, the acf fields will show up and you can populate the content.
ACF: https://www.advancedcustomfields.com/
Page Templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
I'm running a WordPress blog with a lot of published articles and a lot of pictures in the media library. My question is:
Is there a way(plugin?) to make WordPress apply changes I made in the media library(e.g. changing the description/alt text of a picture) to already published articles containing that picture?
Each time a media is used by Wordpress on a template, its proper data (excerpt, etc.) sould be loaded.
Try to clean your cache to force Wordpress to reload the data.
Maybe the theme you use on your blog don't use the right fields to populate the alt text of the pictures. Semantically, it should be 'image_alt' and 'post_description'.
I have a site currently built on Wordpress. I have a requirement to pull out the "latest post" in a category (magazine issue), to allow the latest issue to be displayed in the sidebar of a Posterous blog template, either in an iframe or by other means.
What's the best way to achieve this? Shall I write a custom PHP page which queries the database directly to output the results that I want, and then display it in an iframe on the Posterous template? Or is there an easier way to achieve this?
You could register a widget to the sidebar or simply add code the sidebar.php directly. In the end, all you are doing is building a WP Query for the latest post in a category.