Correct Syntax for uploading files to custom directory in WordPress

(Update to answer: 05.27.15) What finally worked is using ABSPATH: $folderPath = “/jobtracking/files/standard/{$projID}”; mkdir(ABSPATH.$folderPath, 0755, true); $filename = basename($_FILES[‘Attach_Files’][‘name’]); $filetype = $_FILES[‘Attach_Files’][‘type’]; $datei = “files/standard/{$projID}/{$filename}”; $target_path = ABSPATH.$folderPath . “https://wordpress.stackexchange.com/” . $filename; if(move_uploaded_file($_FILES[‘Attach_Files’][‘tmp_name’], $target_path)) { mysql_query(“INSERT INTO files (files.name, files.project, files.user, files.added, files.datei, files.type, files.folder, files.visible) VALUES(‘{$filename}’, ‘{$projID}’, 5, UNIX_TIMESTAMP(now()), ‘{$datei}’, ‘{$filetype}’, 0, ‘ ‘)”); … Read more

Get Video Attachment to post

Video from video clud, like youtube.com, vimeo? If true – use text field or textarea field. User fill youtube share code in this field and you will add this to post_content. Or create custom iframe and tell users insert video link.

Create post from form with image

I think the problem is with your form tag missing enctype=”multipart/form-data” so try changing: <form method=”post” action=””> to: <form method=”post” action=”” enctype=”multipart/form-data”> and as a side note, if you want to redirect to the newly created post change: wp_redirect( ‘http://domain.com’ ); to: wp_redirect( get_permalink($post_id)); exit(); Update: From the comments i understand that want the image … Read more

How to access & display images from a post without textual content ( and vice versa) according to best wordpress practices

This is really a CSS/HTML question as WordPress does not control your layout/styles. You can use one loop and fling the data wherever you want basically. For instance you can wrap individual functions in their own markup //loop start <div class=”left”><?php the_title(); ?></div> //float this title left <div class=”right”><?php the_content(); ?></div> //float this content right … Read more

Gallery Thumbnail Layout Template

One of the better approaches is to unregister WP’s default gallery shortcode function, and add your own customized replacement. WP engineer has a great post about it here. This also will let you fix that funky inline CSS that the default gallery adds to the page.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)