Forum Replies Created

Viewing 15 replies - 136 through 150 (of 173 total)
  • Does this happen with any other theme(s) on the same server?

    It could be a completely unrelated issue to WordPress, like mod_security for example.

    Forum: Hacks
    In reply to: Filters on Post-Meta Text

    You need to be more specific.
    Which plugins are you using? What exactly you are tying to achieve?

    get_pages() has different parameters than WP_Query and/or get_posts().
    Instead of posts_per_page you should use a number parameter instead.

    It’s because get_the_title() returns the title while the_title() echoes the title.

    Consider the following scenario:

    function a() { return 'a'; }
    function b() { return 'b'; }
    function c() { return 'c'; }
    
    echo a() . b() . c();

    Will echo:

    abc

    This is because the functions a, b and c are evaluated first, then the . operator concatenates their values and finally echoes them as one string.

    Now consider the following scenario:

    function a() { return 'a'; }
    function b() { echo 'b'; }
    function c() { return 'c'; }
    
    echo a() . b() . c();

    Will echo:

    bac

    This is because while the functions are being evaluated, b() immediately echoes ‘b’ and returns nothing. Then, when the values are concatenated, first is ‘a’, then it’s nothing (because b() didn’t return a value), and then it’s ‘c’.

    Hope this makes things a bit clearer.

    Forum: Hacks
    In reply to: Header cut off on 1600 screen

    Try making your browser’s width narrower. You’ll see what your friend means. The logo goes off screen to the left.
    The easiest fix would be to make the header image align on the left instead on center.
    I.e.

    .site-header {
        background: url("https://www.annukkajewelrydesign.com/wp-content/uploads/2015/02/AJDBanner_4.png") no-repeat scroll left top / 1600px auto transparent;
    }

    instead of the current:

    .site-header {
        background: url("https://www.annukkajewelrydesign.com/wp-content/uploads/2015/02/AJDBanner_4.png") no-repeat scroll center top / 1600px auto transparent;
    }

    Depending on the custom field you have created, it either stores the category id or the category slug. You need to know which, and also the name of the field.
    If for example the field name is my_category and it stores the id you would then do:

    $the_query = new WP_Query( array(
        'cat' => get_field('my_category')
    ) );

    If 'my_category' holds the slug, just replace 'cat' with 'category_name'

    When/where is you post type registered?
    This is very likely caused by register_taxonomy() called before register_post_type()

    Try moving the whole register_post_type() call inside the create_quote_taxonomies() and right before the register_taxonomy() call.

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Hi there,
    the shortcode doesn’t really play with the new Google Maps, as Google now disallows direct embedding.
    In order for the shortcode to work, you need to visit the classic google maps, i.e. https://www.google.com/maps?output=classic
    Once you find the place that you want shown, click on the chain button and copy the first URL shown (not the iframe one). Also, please do NOT shorten the URL.

    This is probably the shortcode that you need for your website.
    [googlemap src="https://www.google.com/maps?q=3311+Pacific+Blvd+SW,+Albany+OR+97321&hl=en&ll=44.610451,-123.109188&spn=0.016559,0.038581&sll=37.09024,-95.712891&sspn=37.683309,79.013672&hnear=3311+Pacific+Blvd+SW,+Albany,+Oregon+97321-7707&t=m&z=15" /]

    Let me know how everything turns out.

    Hi there,
    I’m sorry to hear that you are disappointed with our design decision.

    The reason the widget now needs a separate list of icons and urls is just a matter of flexibility.

    With the old widget, you could only have a specific number and ordering of icons, no matter where you placed the widget.

    Now there is no limitation. Yes, it might be a burden to set-up identical widgets for multiple sidebars, however we’ve found that most of our users place just one widget instance in a widget area that appears site-wide, such as in the header or the footer.

    Also, now you can have different icons depending on whatever, using plugins such as Widget Logic and WooSidebars.

    You might also want to give Widget Wrangler a spin for cloning/repeating widgets.

    I hope the reasoning I just wrote, make the pain go away ??
    I appreciate your feedback, no matter what.

    Hi there,
    thanks for the thumbs up.
    I’ll make sure the change makes it to the next update. I’ll actually make sure to release an update as soon as I get the time ??

    Plugin Author Anastis Sourgoutsidis

    (@anastis)

    Hi there,
    sorry for the late response but I couldn’t get my hands on a windows phone.
    Anyway, I’ve checked your website from a Lumia 1020 with Internet explorer, and it seems to be working just fine.
    Did you resolve the issue?

    Forum: Hacks
    In reply to: Repurpose Comment Email Field

    +1 for everything bcworkz said.

    Since it’s a paid theme, you should contact your theme’s developer(s) and they should be able to guide you around their code.

    Forum: Hacks
    In reply to: Change widgets.php

    Try changing:

    // This fires whenever sidebars_widgets gets updated.
    add_action( 'updated_option', 'my_updated_option' );
    function my_updated_option( $option ) {
    	if( 'sidebars_widgets' == $option ) {
    		update_user_meta( get_current_user_id(), 'sidebars_widgets', wp_get_sidebars_widgets() );
    	}
    }

    to:

    // This fires whenever sidebars_widgets gets updated.
    add_action( 'updated_option', 'my_updated_option', 10, 3 );
    function my_updated_option( $option, $old_value, $value ) {
    	if( 'sidebars_widgets' == $option ) {
    		update_user_meta( get_current_user_id(), 'sidebars_widgets', $value );
    	}
    }

    Forum: Hacks
    In reply to: Change widgets.php

    The only solution I can think of this, is saving a different copy of $sidebars_widgets in each user’s meta, and overwriting the global one depending on who is logged in.

    I’d go about it like this. I assume all requests are from logged in users, so I’ll not add any is_user_logged_in() checks.

    This would go on your functions.php or similar:

    // Registed a sidebar for the user.
    add_action( 'widgets_init', 'my_widgets_init' );
    function my_widgets_init() {
    	register_sidebar( array(
    		'name'          => 'Sidebar Name',
    		'id'            => get_current_user_id() . '-homescreen-widgets',
    		'description'   => 'Place here the widgets that you want to display on your homescreen.',
    		'before_widget' => '<aside id="%1$s" class="%2$s widget group">',
    		'after_widget'  => '</aside>',
    		'before_title'  => '<h3 class="widget-title">',
    		'after_title'   => '</h3>'
    	) );
    }
    
    // This fires whenever sidebars_widgets gets updated.
    add_action( 'updated_option', 'my_updated_option' );
    function my_updated_option( $option ) {
    	if( 'sidebars_widgets' == $option ) {
    		update_user_meta( get_current_user_id(), 'sidebars_widgets', wp_get_sidebars_widgets() );
    	}
    }
    
    // Overwrite the array for all wp_get_sidebars_widgets() calls.
    add_filter('sidebars_widgets', 'my_sidebars_widgets');
    function my_sidebars_widgets($sidebars_widgets) {
    	$sidebars_widgets = get_user_meta(get_current_user_id(), 'sidebars_widgets');
    	return $sidebars_widgets;
    }

    And in your frontpage template:
    dynamic_sidebar( get_current_user_id() . '-homescreen-widgets' );

    Hope this helps.

    Forum: Hacks
    In reply to: Change widgets.php

    Hi there,
    what are you trying to achieve exactly?
    Even if you manage to have different widgets appear to different users in the back-end, how would that work in the front end? What would a non-logged in user see?

Viewing 15 replies - 136 through 150 (of 173 total)