Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter bobibrown0

    (@bobibrown0)

    Hello, thank your for your answer.
    The screenshot was actually taken directly from the demo page on UM website.
    The problem occurs on my samsung galaxy S10 (HD+ 1520×720), that’s why I went on to check what was going on firefox.
    It seems it happens only for a width below 370px, i figured it out when trying to replicate your test on edge. Here’s a video of the issue:

    • This reply was modified 4 months, 1 week ago by bobibrown0.
    Thread Starter bobibrown0

    (@bobibrown0)

    OK, I made it!! I change the method to this:

    if ( $in_same_cat || ! empty( $excluded_categories ) ) {
    		$join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
    
    		if ( $in_same_cat ) {
    			if ( ! is_object_in_taxonomy( $post->post_type, 'category' ) )
    				return '';
    			$cat_array = wp_get_object_terms($post->ID, 'category', array('fields' => 'ids'));
    			if ( ! $cat_array || is_wp_error( $cat_array ) )
    				return '';
    			$join .= " AND tt.taxonomy = 'category' AND tt.term_id IN (" . implode(',', $cat_array) . ")";
    		}
    
    		if ( $same_format ) {
    			$join .= " AND p.ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id=420 ) ";
    		}
    
    .
    .
    .
    .

    I don’t know if it’s the best solution to make it work, especially when I’ll have more posts, but it works for now.
    I had to find the current post format id, but instead I actually only need to make sure it is in one specific format(id:420).

    I hope it will help someone.

    Thread Starter bobibrown0

    (@bobibrown0)

    Ok actually it will be harder than I thought.

    the junction is the following:

    $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";

    I made some test by adding the following lines right after:

    if ( $same_format ) {
    			$join .= " INNER JOIN $wpdb->terms AS t ON tr.term_taxonomy_id = t.term_id ";
    		}

    and after the condition for $in_same_cat :

    if ( $same_format ) {
    			$format = get_post_format( $post->ID );
    			if ( empty($format) || is_wp_error( $format ) )
    				return '';
    			$join .= " AND t.name = 'post-format-".$format."'";
    		}

    The thing is that it will never work since I need to choose between taxonomy “category” or “post_format” and term_id “category_ID:XXX” and “post-format-ID:XXX”

    can’t have both at the same time or I will have duplicate entries… plus I need to get the post-format ID.

    okay, for example I don’t want the user to be able to see the wordpress dashboard.

    So I tried:

    function tml_action_url( $url, $action, $instance ) {
    	if ( 'profile' == $action )
    		$url = 'http://mywebsite.com/customdashboard/';
    	return $url;
    }
    add_filter( 'tml_action_url', 'tml_action_url', 10, 3 );

    And yes I added this to the very bottom of my function.php file. I guess I did a mistake then?

    I’d like to know this too, where do you add the tml_action_url filter ?
    I put it in the function.php of my theme, but not working.

    Thread Starter bobibrown0

    (@bobibrown0)

    Alright, I haven’t tried anything yet, but I found the function, I’ll work on it later, thanks a lot for the help!

    Thread Starter bobibrown0

    (@bobibrown0)

    You’re right, it’s obvious but I did not thought about that, thanks for the advice. By the meantime, I haven’t been able to locate the function.

Viewing 7 replies - 1 through 7 (of 7 total)