开发者

Selecte and retrieve file path to image using dialog box

开发者 https://www.devze.com 2022-12-29 06:39 出处:网络
I\'m ex开发者_如何学Cpanding Wordpress to function more like a CMS. This includes relating image to a post.

I'm ex开发者_如何学Cpanding Wordpress to function more like a CMS. This includes relating image to a post.

Currently I have a text field where I paste an image path. Now I want to click a button which opens a dialog box, then I navigate to the right folder and select a file to "open" (from server side).

The file path is returned.

How can I go about accomplishing this?


Have you heard of Post Thumbnails?. It sounds like you're duplicating what they do.

Add add_theme_support( 'post-thumbnails' ); to the functions.php file of your current theme.

If you don't have a file named functions.php in your theme, create one, and put this in it:

<?php
add_theme_support( 'post-thumbnails' );
?>

if that still does not do what you want you might look at Custom Fields.

0

精彩评论

暂无评论...
验证码 换一张
取 消