Is it possible to list post attachments in a sub URL endpoint with a dedicated template?

I think I found it myself. Now I’ve successfully managed to add a /photos endpoint to a permalink URL, such as: http://mywordpressite.com/projects/a-project/photos And then a custom template, photos.php will load and show – with access to the global $post variable. Helpful links: http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint http://codex.wordpress.org/Template_Hierarchy In my functions.php I added functions for the single_template and query_vars … Read more

loop not displaying posts on custom template page

Make a copy of press.php and rename it to home.php. The page you selected “Press” to be the designated page for your posts in the dashboard under, Settings > Reading > Posts Page: [Press] …now falls under the control of the template hierarchy as listed by Milo. First WordPress will look for the existence of … Read more

Returning Variables back into a template

There’s filters for that. Example: add_filter( ‘template_filter’, ‘wpse_102706_filter_callback’, 10, 2 ); function wpse_102706_filter_callback( $defaults, $case ) { $args = wp_parse_args( array( ‘some_key’ => ‘some_modified_value’ ), $defaults ); return $args } Then in your template just add in the defaults: apply_filters( ‘template_filter’, array( ‘some_key’ => ‘default_val’ ), ‘single’ ); More info in Codex about the Plugins … Read more

Custom php file in wordpress

Andrew Bartel is on the right path, but the link doesn’t quite do what you want. For static PHP files to access WordPress core functionality you need to add this to the top of the PHP file: define(‘WP_USE_THEMES’, true); /** Loads the WordPress Environment and Template */ require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ ); (This … Read more

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