gbrent
Forum Replies Created
-
Forum: Plugins
In reply to: Sidebar is magicaly showing up. Why?define(‘WP_USE_THEMES’, false);
Worked for me!
Forum: Plugins
In reply to: How to add posts without wp-admin? Is there a function?SWEET!!!……
here is the way to insert a post by giving it your own data without the formhttp://codex.wordpress.org/Function_Reference/wp_insert_post
Forum: Plugins
In reply to: How to add posts without wp-admin? Is there a function?Well I do have custom code. All it does is pull in an image, give it an ID, date and other info and sticks it in a separate DB. It is saved to the Hard Drive and recalled later….WP has nothing to do with these actions. When I display the images they are all on a custom template Page and I just find them in a directory where I put them.
Example:
href—————– image_id ——image_filename
http://someplace.com/1 | 1 | file1-gf56.jpg
http://someplace.com/1 | 2 | file2-dfg45.jpg
http://someplace.com/1 | 3 | file3-45f645.jpg
http://thatplace.com/2 | 4 | file4-23ghf23.jpg
http://hersgdffe.com/3 | 5 | file5-34ghj345.jpgSo with the above data, I want to make a post with images where all href = ‘http://someplace.com/1’. So in the end the post is basically all the images that came from http://someplace.com/1
If I do the wp_insert_attachment() way… I will have 3 separate posts when I only want one.
Is there a function like wp_insert_attachment() that is more like insert post?Forum: Installing WordPress
In reply to: Errors with page links after migrationNo, when you install Apache, rewrite is not enabled by default
Forum: Plugins
In reply to: Sorting pages by a custom fieldMichael,
Yeah that’s what I figured out while I was looking at the DB. For others here is what I did…
I went through each Page that was a city and I added the custom field ‘state’ then I did the following query:SELECT DISTINCT p.post_title, p.post_name, p.guid, m.meta_value FROM wp_posts p
LEFT JOIN wp_postmeta m ON (p.ID = m.post_id)
WHERE meta_key = ‘state’
AND post_status = ‘publish’
ORDER BY menu_order desc, meta_value ASCNow I have not done it yet but when you l0op over this dataset you need to compare the meta_value in the current loop with the meta_value from the previous loop. If they are different then you print it with Bold or indent the cities etc.