Shortcodes not outputting in correct divs
the_ID outputs (echoes) the ID. Use get_the_id () Same for the_title.. Use get_the_title
the_ID outputs (echoes) the ID. Use get_the_id () Same for the_title.. Use get_the_title
Take the GA code from your header and wrap it in a function hooked to wp_head; function __analytics_head() { $options = get_option( ‘themename_theme_options’ ); if ( !empty( $options[‘analytics’] ) ) : ?> <script type=”text/javascript”> var _gaq = _gaq || []; _gaq.push([‘_setAccount’, ‘<?php echo esc_js( $options[‘analytics’] ) ; ?>’]); _gaq.push([‘_trackPageview’]); (function() { var ga = document.createElement(‘script’); … Read more
I do what you’re trying to do by adding it directly to the body tag. Example on how to add a class to interior pages. <body <?php if(!is_front_page()){body_class(‘interior-page’);}else{body_class();} ?>>
We got it working by changing the hook: add_action( ‘wp_loaded’, ‘wp_html_compression_start’ );
Hi add this code to your Function.php and jquery-ui.js should be loaded correctly on your website. // Register Script function custom_scripts() { wp_register_script( ‘jquery-ui’, ‘/assets/js/jquery-ui.js’, false, false, true ); wp_enqueue_script( ‘jquery-ui’ ); } add_action( ‘wp_enqueue_scripts’, ‘custom_scripts’ );
If you want to target only one specific status change is probably easy / efficient use the {$old_status}_to_{$new_status} filter, in your case: add_action(‘draft-to-pending’, ‘do_something’); add_action(‘auto-draft-to-pending’, ‘do_something’); function do_something ( $post ) { // do something with the $post object }
The Media library doesn’t directly pull from the uploads folder. It reads in Attachments, which place their attached media in the uploads folder. If you want to access them through WordPress, you will need to upload them as Attachments.
Yes you can add an around the title of the widget, you do this in the register_sidebar code which you would put in your functions.php add_action( ‘widgets_init’, ‘theme_register_sidebars’ ); function theme_register_sidebars() { register_sidebar( array( ‘id’ => ‘mysidebar-sidebar’, ‘name’ => __( ‘My Sidebar’, ‘themename’ ), ‘description’ => __( ‘Widgets for my sidebar’, ‘themename’ ), ‘before_widget’ => … Read more
Since you only want to hook into the posts on your homepage, I think you only need something like this: <?php add_action( ‘pre_get_posts’, ‘my_change_sort_order’); function my_change_sort_order( $query ){ if ( ! is_admin() && $query->is_main_query() ) : if ( is_front_page() ) : //Set the order ASC or DESC $query->set( ‘order’, ‘ASC’ ); //Set the orderby $query->set( … Read more
I used the following code and the bits of code no longer appear: add_action( ‘wp_head’, ‘remove_my_action’ ); function remove_my_action(){ remove_action( ‘wp_footer’, ‘wp_underscore_playlist_templates’, 0 ); remove_action( ‘admin_footer’, ‘wp_underscore_playlist_templates’, 0 ); }