Using filter in the widget causes fatal error

Your code should look something like this: class my_Widget extends WP_Widget { … function filter_where( $where=”” ) { … } function widget( $options ) { … add_filter( ‘posts_where’, array( $this, ‘filter_where’ ) ); $query = new WP_Query( $args ); remove_filter( ‘posts_where’, array( $this, ‘filter_where’ ) ); } } This will keep the function within your … Read more

Why cant I change the text on this theme?

Looking through the docs reveals that you can either disable that slider all together, or add your own slides in it which will replace the default text that you see now. To add your own slides, use the instructions here: http://siteorigin.com/pitch-documentation/content/home-page-slider/ To disable the slider you should probably hunt for the option. I’m guessing that … Read more

Posts & page twice display

I just figure out the problem, the problem lies in WPML plug-in. I consider the answer to be posted here for other users. You have to put the following query in page.php or single.php to avoid duplicate/twice posts. <?php wp_reset_query(); ?>

Pages and posts on ElegantTheme featured slider [closed]

There are probably many problems here, starting with the use of query_posts() for a secondary query. The proper method is new WP_Query(), passing the relevant arguments. For example $featured_query_args = array( ‘post_type’ => array( ‘post’, ‘page’ ), ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘posts_per_page’ => (int) $featured_num, ‘post__in’ => (array) array_map( ‘intval’, et_get_option( ‘aggregate_feat_pages’, ”, … Read more

linking to an svg through comments_popup_link

The problem is the relative URL. You have to be careful with relative URLs in WordPress. Relative URLs are interpretted by the browser but the browser doesn’t know about the URL rewriting that happens behind the scenes. Think about where your index file appears to be– http://example.com/— vs. where it actually is– http://example.com/wp-content/themes/your-theme-name/index.php. Similar problems … Read more

What data does WordPress theme update pull If there is an update?

Very typical and very annoying situation unfortunately. WordPress doesn’t “pull” update information. Instead it submits plugin and theme information to the API at wordpress.org, which responds with updates available. In practice matching of updates is loose and exact logic is not disclosed. Name matters a lot, folder name as well. Rest matters to some unknown … Read more

Widgets not showing on sidebars

You’ve registered your sidebars with the ids of sidebar-left and sidebar-right but you are are attempting to display them using only left and right. You need to use the correct ids. That is: dynamic_sidebar( ‘sidebar-left’ ); You need that id with both dynamic_sidebar() and is_active_sidebar() if ( is_active_sidebar( ‘sidebar-left’ ) ) { dynamic_sidebar( ‘sidebar-left’ ); … Read more

Undefined variable error in theme option after updating theme [closed]

@pzstar it is a good approach to check if your variables are assigned a value or not. If a variable or an index in an array is not declared/assigned then you’d probably get such error. I would suggest you to use isset(). <input id=”welcome_post_char” type=”text” name=”abc_options[welcome_post_char]” value=”<?php echo (isset($settings[‘welcome_post_char’]))? esc_attr($settings[‘welcome_post_char’],’abc’): ”}; ?>”>