WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?

You can do that within the loop using wp_get_attachment_image. Something like (not tested): //loop starts //values for get_posts ( or wp query if you prefer) $args = array( ‘post_type’ => ‘attachment’, //gets the attachments aka your images ‘numberposts’ => -1, ‘post_parent’ => $post->ID ); // some attributes you want added to each image $default_attr = … Read more

Sliding pages + wordpress [closed]

This is what came to mind though there could be some easy implementations as well: jQuery(document).ready(function(){ jQuery(document).scroll(function(){ if(jQuery(document).scrollTop()>0){ jQuery(‘#first-header’).hide(); jQuery(‘#second-header’).show(); } else{ jQuery(‘#second-header’).hide(); jQuery(‘#first-header’).show(); } }) })

Add JavaScript in admin in custom plugin [duplicate]

Admin area has its own hooks in header and footer, respectively: do_action(‘admin_enqueue_scripts’, $hook_suffix); do_action(“admin_print_styles-$hook_suffix”); do_action(‘admin_print_styles’); do_action(“admin_print_scripts-$hook_suffix”); do_action(‘admin_print_scripts’); do_action(“admin_head-$hook_suffix”); do_action(‘admin_head’); and do_action(‘admin_footer’, ”); do_action(‘admin_print_footer_scripts’); do_action(“admin_footer-” . $GLOBALS[‘hook_suffix’]);

Using jQuery .after inside loop

WordPress requires no-conflict for jQuery. Change this: var tiles = $(‘#article-tile:nth-child(‘+adLoc+’)’); $(tiles).after(adTile); …to this: var tiles = jQuery(‘#article-tile:nth-child(‘+adLoc+’)’); jQuery(tiles).after(adTile); Or else wrap your entire script accordingly: jQuery(document).ready(function($) { // $() will work as an alias for jQuery() inside of this function });

Equal height sections in custom Headway Theme

We can do this without touching theme files either by using a child theme or Writing a Custom Plugin, To include only css I’d use plugin rather than a child theme. Example – <?php /* Plugin Name: My Styles Description: My Custom Styles for THEME-NAME */ //Create a `my-style.css` in plugin folder add_action( ‘wp_enqueue_scripts’, ‘wpse64258_custom_styles’ … Read more

wordpress before or after javascript problem

There’s a reason, why one should use the proper hook, which – in this case – is wp_enqueue_scripts. Then always keep in mind, that some plugins might require a dependency/are dependent on another Javascript library like jQuery. Now this example shows you how to enqueue your script With the right path/URI API function With jQuery … Read more

Custom attributes to javascript tags

I am afraid this is impossible. The markup is hard coded in /wp-includes/class.wp-scripts.php: if ( $this->do_concat ) $this->print_html .= “<script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/70184/$src”></script>\n”; else echo “<script type=”text/javascript” src=”https://wordpress.stackexchange.com/questions/70184/$src”></script>\n”;