Viewing 1 replies (of 1 total)
  • Thread Starter rodrigovolponi

    (@rodrigovolponi)

    I’ve made a stupid plugin that SURPASSES que original WordPress Query to do what i needed. But it’s very far from a good solution.

    The problem seems to be with WP_QUERY. It does not allow any ?comments_popup=ID to have post_type=page. It outputs only post_type=post.

    So, let’s make the actual SQL instruction to have both “post_type=post” and “post_type=page”. I’m afraid it will slow down the server a little bit more. Again.

    function rvl_comments_popup_page($dados) {
    	$procura_por = "post_type = 'post'";
    	$substitui_por = "(post_type = 'post' OR post_type = 'page')";
    	$s = str_replace($procura_por,$substitui_por,$dados);
    	return $s;
    }
    
    add_filter('posts_request', 'rvl_comments_popup_page');

    Any better suggestions? Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Show comments Popup to Pages (not the link, the actual comments)’ is closed to new replies.