One folder to be accessible by one user

One solution might be to directly restrict access to the file on the server, but utilize a url rewrite to display the content — only if the id matches in the request. Obviously this doesn’t answer every question in the scenario but it does provide a proof-of-concept to indirectly convert a url into a file. … Read more

media_handle_sideload() fails

The Problem was the @copy() in wp-includes/file.php class of wordpress. This will mask the real problem why the file could not copied (the rights on on htdocs was not ok). So the problem is fixed.

How make wp_nav() with my css?

First step is to register the name (or names) for your menus. In your example, top-nav seems appropriate. function vd_register_menu() { register_nav_menu(‘top-nav’,__( ‘Top Nav Menu’ )); } add_action( ‘init’, ‘vd_register_menu’ ); This will allow you to build your menu items in the WP admin under Appearance > Menus. To display your menu on the site, … Read more

How to create a loop that will display one post and stop?

query_posts() can alter the WP query even when it is executed and it should be placed at least before you start the loop i.e. have_posts(). Currently you are placing it after setting up post data i.e. the_post(). Which is resulting in unexpected behavior. Example: global $query_string; //Get current query arguments query_posts($query_string.”&featured=yes”); if (have_posts()) { while … Read more

How does $wpdb->get_var work with offset?

You must specify values for column_offset and row_offset. For example: <?php $wpdb->get_var( null, 5, 0 ); ?> Will return “Hello World” (see attached image) But for that to work you had to have a previous query like this: <?php $wpdb->get_var( “SELECT * FROM $wpdb->posts” ); ?>

Windows 10 Printer that Sends to WordPress [closed]

Not a print to WordPress plugin as such, but this will import the PDF text into the editor. https://wordpress.org/plugins/aspose-pdf-importer/ Or use a custom PHP class such as: http://www.phpclasses.org/package/9423-PHP-Convert-PDF-to-HTML-using-Poppler.html which will convert the pdf to html, hopefully with styles. You’d need to create a page template for the html if you want to change the entire … Read more

How to create a loop where loop changes every post?

The PHP modulus operator gives you the remainder from dividing 2 numbers. The remainder from the division of any number by two is either 0 or 1, so we can use that to provide an “alternator”. We use the current_post var as a counter, which is available in any WP_Query object: while( have_posts() ){ the_post(); … Read more

True or False: Is an Apache error or PHP error the same as a WordPress error?

WordPress errors are application level errors. PHP errors are language syntax or usage errors and appach error are errors detected during the web server operation. Errors, especially minor ones, might be reported “upwards” and look like they are wordpress application errors, or logged downwards and be part of the apache server error log if the … Read more