New answers tagged

1

As discussed in the comments, your database prefix settings are off-kilter. Check the database prefix actually in use in your database, and make sure it's the same as the one in wp-config.php. Also make sure all of your WordPress-related tables have the same prefix. You'll also need to search through your database, particularly in the _options table, as ...


2

There is no use for converting an integer to a string when you just need to display the result or for simple checking against a hardcoded known datatype value. Converting datatypes is only useful when you need to validate values strickly against a certain specific datatype. Your issue is that you do not exactly know how to test your values. 0, either an an ...


0

Well, comments ( if i remember correct and nothing has changed from v4 ) are custom post types, so u can add post_meta to it, like response => true ( positive ) or false ( negative ). Then u could make custom query ( WP_Comment_Query ) to get comments for certain post with meta parametrs ( ak. Custom Field Parameters ) You would need 2 queries, 1 returning ...


3

Currently it is not available in WP CLI. See https://github.com/wp-cli/wp-cli/blob/master/php/commands/comment.php#L136 If you want, you can have your own customized comment generation command. See command cookbook. http://wp-cli.org/docs/commands-cookbook/


0

I don't know what your comments.php looks like, so I cannot tell how to adapt your current code, but I can generally tell you how to approach this. Normally, WP will assume that you want the latest comments of the current post. If you want something else, you start with the condition under which you want your second set of comments to show and add this to ...


0

You have no need callback function. Only reverse_top_level: true is find for what you want to do. Just remove 'callback' => 'custom_comments_callback', from your array. <?php wp_list_comments(array( 'reverse_top_level' => true, 'avatar_size' => 50, 'reply_text' => 'Reply to this comment' )); ?>


2

Please try: $args = array( 'posts_per_page' => -1, 'post_type' => 'thread' ); $thread_posts = get_posts( $args ); // Get all posts of thread. foreach($thread_posts as $thread_post_object) { /*not sure really need to be working IDs only, but is simpler, plus made checking was getting right ones easier */ $thread_post_IDs[] = $...


2

I was wrong when I said we had gone back and disabled all comments and trackbacks for previous posts. As it turns out, we did not. The comment from Dan above made me realize our error as when I began to scan our logs, I noticed these were all previously published pages. Whomp, whomp. Our solution was to run the following two SQL statements on our database ...


0

I have just solved this! The emoji needs to be converted to UTF8 encoded string while storing in MySQL database and of course your database column collation must be utf8mb4: <?php utf8_encode($comment); ?> Then while displaying do the reverse: <?php utf8_decode($comment); ?> I'm sorry I don't have code for WordPress as I use it only as a CMS to ...


1

I found an exact solution I'm looking for. function my_comment_link_filter( $link ) { $link = str_replace( get_permalink() , $custom_permalink , $link ); return $link; }; add_filter( 'get_comment_link', 'my_comment_link_filter' ); It does exactly what I am looking for: It replaces the Page Permalink with the dynamic permalinks when I call the ...


1

I'm not completely sure what you are trying to accomplish, but here's what I think. Normally you would generate a link to a comment like this: echo '<a href="' . get_permalink($comment->comment_post_ID) . '#comment-' . (strval($comment->comment_ID)) . '">'; The problem with filtering get_permalink() is that the filter must know that it is ...



Top 50 recent answers are included