How to show user’s liked posts and collections when the user logs in?

I want to create a plugin which enables a user to like and collect things(posts, links, qoutes, pictures etc) while he/she is logged in and the user would be able to see all his or her liked & collected times on his front-end profile page. What I know is how to create a user and assign roles programmatically. But I don’t know how to get posts “marked” as liked and enable them to add items in his collection ( my be with a button option which says “add to my collection”) and then save it to the users collection and show it on the front-end profile page. It would be really helpful if I could get directions that what should I search for ? i-e keywords to search. Any suggestion idea whould be appreciated. Thanks

WordPress Custom Post Status not Public but Viewable Through Link: Privately Published Posts

I have been working on my site to bring up private posts on my site. I built a custom post status for this purpose.

My goal is to exclude posts belonging to that post status from search, from Blog Page, from WordPress Queries, RSS Feed etc. Basically there should be no mentions of it anywhere on site.

Till here it seems simple, but the problem is that I WANT people to be able to view the post via direct link.

Basically I want it to be not mentioned throughout my site, but if someone visits it from direct link, they can view it.

function custom_post_status(){  register_post_status( 'privatised', array( 'label' => _x( 'Privately Published', array('post', 'download')), 'public' => false,  'exclude_from_search' => true, 'show_in_admin_all_list' => true,  'show_in_admin_status_list' => true,  'label_count' => _n_noop( 'Privately Published <span class="count">(%s)</span>', 'Aggregated <span class="count">(%s)</span>' ),  ) );  }  add_action( 'init', 'custom_post_status' );  

Here if you see in the Array, the first option is Public, and I set it to false, which basically ensures that my post is not there on my Blog Page, or search, or Taxonomy Page, or RSS FEED etc. Etc. But if I open the same post via it’s direct url, then it gives a 404, because not found…

Please help, me have my post visible only through the direct link of it.

As a sidenote, Is it possible that I can have it public, and then exclude it from Taxonomy and all, like I can do with exclude from search…

How can I change field values of posts before displaying

I have wordpress project with woocommerce. What I’m trying to achieve is to change values before displaying them on the view page.

For example depending on session/cookie I want to change the language of post title and content

Using the hooks the_title, the_content I was able to achieve it. The problem is when I try to do the same for the_excerpt hook, it’s just never called.

Relevant code from functions.php :

add_filter('the_title', 'custom_lang_title');  function custom_lang_title($  title){     if($  otherlang){         return get_field('lang_title');     }else{         return $  title;     } }  add_filter('the_content', 'custom_lang_desc');  function custom_lang_desc($  content){     if($  otherlang){         return get_field('lang_content');     }else{         return $  content;     } }   //The code below does not work  add_filter('the_excerpt', 'custom_lang_excerpt');  function custom_lang_excerpt($  desc){     if($  otherlang){         return get_field('lang_excerpt');     }else{         return $  desc;     } } 

I’m completely new to wordpress, so if don’t really know what other info can be helpful. I can provide more info on request.

I want to know where to share posts after published

Hello Guys

Happy New Year!

I want to know where to share the link of your blog post or say post, so a little bit of traffic can be obtained on the post, especially when you suck at having bad networking skills.

Please also tell if there is any area on DigitalPoint, where I just can post my blog posts and don't get banned like on Reddit etc.

Thanks & Regards
Raj Kumar

display posts on elementor widget

I am trying to display posts in a Elementor widget.selection section of Post type seems on settings but there is no content or else command on page.What is my mistake?

use \Elementor\Controls_Manager;   //paste    /**  * Get All POst Types  * @return array  */     class Elementor_oEmbed_Widget extends \Elementor\Widget_Base {  //paste      public function eael_get_all_types_post()     {         $  posts = get_posts([             'post_type' => 'any',             'post_style' => 'all_types',             'post_status' => 'publish',             'posts_per_page' => '-1',         ]);          if (!empty($  posts)) {             return wp_list_pluck($  posts, 'post_title', 'ID');         }          return [];     }     $  this->add_control(     'post_type',     [         'label' => __('Source', 'plugin-name'),         'type' => Controls_Manager::SELECT,         'options' => get_post_types(['public' => true, 'show_in_nav_menus' => true], 'objects'),            // 'default' => key($  this->post_types),     ] );  $  this->add_control(     'posts_ids',     [         'label' => __('Search & Select', 'plugin-name'),         'type' => Controls_Manager::SELECT2,         //'options' => $  this->eael_get_all_types_post(),         'label_block' => true,         'multiple' => true,         'condition' => [             'post_type' => 'by_id',         ],     ] );    protected function __render_template($  args, $  settings)     {          $  settings = $  this->get_settings_for_display();          $  html = wp_oembed_get($  settings['url']);          echo '<div class="oembed-elementor-widget">';          echo ($  html) ? $  html : $  settings['url'];          echo '</div>';            //paste            $  query = new \WP_Query($  args);         if($  query->have_posts()) {             while ($  query->have_posts()) {                 $  query->the_post();                 get_the_author_meta("display_name");             }          }         else         {echo "<div style=background:red> lsdkjf </div>";} 

Include posts by taxonomy type

So I have this webpage here https://100awesome.net/redstone/ with a posts widget. Using the plugin custom post type UI I created my own post type called videos. Videos has a taxonomy named subjects with in that, 4 different subjectsenter image description here

Now I want to include posts in my post list widget by a type of subject, I do not want all topics on the same page. This is how I set up the query right now

enter image description here

Show Two custom Post type and their posts on category page

I have Two Custom Post Types “Article ” & “News” and they both use same categories like [ audit , income , tax] . I want when i open audit category page then the post showsn like below: enter image description here

the code i already tried on archieve.php but isnt working:

<?php      $  cats = get_the_category();     $  args = array(         'post_type' => 'articles',         'post__not_in' => array( get_the_ID() ),         'posts_per_page' => 5,         'cat'     => $  cats[0]->term_id,         'meta_query' => array(                     array(                     'key' => 'recommended_article',                     'value' => '1',                     'compare' => '=='                         )                     )     );     $  query = new WP_Query( $  args );  ?>    <?php if( $  query->have_posts() ) : while( $  query->have_posts() ) : $  query->the_post(); ?>     <!--HTML-->  <?php endwhile; endif; wp_reset_postdata(); ?>