I would like to display different text on different pages
Of course, use this: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page Example: if(is_page(‘Contact Us’)){ //contact us h1… } else….
Of course, use this: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page Example: if(is_page(‘Contact Us’)){ //contact us h1… } else….
<?php query_posts( ‘cat=36&post_type=athletes&showposts=1&orderby=rand’); ?> changed to : <?php $args = array( ‘numberposts’ => 36,’category’ => ‘1’,’post_type’ => ‘athletes’, ‘orderby’ => ‘rand’); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <h2><a href=”https://wordpress.stackexchange.com/questions/56381/<?php the_permalink(); ?>”><?php the_title(); ?></a></h2> <?php endforeach; ?>
I am not seeing you registering the widget in this code. For inside of a theme: register_widget(‘WP_Widget_Mood’); For inside of a plugin: add_action( ‘widgets_init’, create_function(”, ‘return register_widget(“WP_Widget_Mood”);’) );
The problem was the double quotes which are needed in normal shortcode usage in posts and pages for some reason when using do_shortcode the double quotes in the attributes where breaking the function. Working code below <div> <?php $lat = get_field(‘woo_maps_lat’); $long = get_field(‘woo_maps_long’); echo do_shortcode(‘[forecast location=’ . $lat .’,’.$long. ‘]’); ?> </div>
Looks like the problem is with the id‘s. Try putting some unique names. For example, this doesn’t works in TwentyEleven, as it registers a sidebar with the same ID: ‘name’ => __(‘Main Sidebar’), ‘id’ => ‘sidebar-1’, From the Codex: id – Sidebar id – Must be all in lowercase, with no spaces (default is a … Read more
Just… call the function again – you only need to include it once! include ‘./path/to/lib.php’; echo_tweet_js(); // a little tweeting here … echo_tweet_js(); // and a little tweeting over here!
I figured it out after looking at wp_option tables for my widget and the sidebars_widget option I figured out that my widget name has to be none white space separated, in my case it should be anzima_posts_widgets, also I have to include the base-id in the control_ops parameter as the first index. Another issue I … Read more
The template field allows you to enter what will appear on the event list widget. It accepts various place holders (you can see the documentation here – the template can be used for the [eo_events] shortcode too). One of the place-holders is %start{date-format}{time-format}% which outputs the start date/time of an event with the specified date … Read more
I did! Write this codes in functions.php add_filter( ‘widget_categories_args’, ‘force_widget_cat_args’ ); function force_widget_cat_args($cat_args) { $cat_args[‘hierarchical’] = 0; return $cat_args; }
I fixed this by adding: global $post; More specific: I can’t explain why this works, that’s beyond my WordPress skills, but I added it right after the start of the query, so the code looks like this: <?php global $post; $loop = new WP_Query( array( ‘post_type’ => ‘kurs’, ‘posts_per_page’ => ‘5’, ‘meta_key’ => ‘dato’, ‘meta_value’ … Read more