Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:27:56+00:00 2026-05-24T05:27:56+00:00

I would like to associate custom post types posts which are products with the

  • 0

I would like to associate custom post types posts which are products with the standard wordpress posts. Can anyone point me in the right direction how to accomplish this?

The reason being is i want to write blog articles and some of my blog articles may relate to a specific product. So on the products page i want to be able to have a link of related articles to that product.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:27:57+00:00Added an answer on May 24, 2026 at 5:27 am

    I would suggest to save an array or string of the IDs of related posts / related product as using a custom field in the backend of your Website.

    On the frontend of your Website you can get the associated IDs from the Database and Make Links using the functions <?php echo get_the_title(ID); ?> and <?php echo get_page_link(ID); ?>.

    Depending on how comfortable the backend must be to edit, you can add custom Meta Boxes to the backend, using the following code in functions.php.

    add_action('admin_init', 'register_meta');
    add_action('save_post', 'save_metadaten');
    
    
    function register_meta(){
            add_meta_box("produkt_meta","Daten des Produkts","produkt_meta","produkt","normal","high");
    }
    
    function produkt_meta() {
        global $post;
        $custom = get_post_custom($post->ID);
        $preis = $custom["produkt_preis"][0]; ?>
    
        <h4>Produkt-Daten</h4>
        <p style="padding-bottom:4px;"><label style="width:200px; display:inline-block;">Preis:</label><input size="5" name="produkt_preis" value="<?php echo $preis; ?>" /> €</p>
        <?php
    }
    
    function save_metadaten(){
        global $post;
    
        // check if there are associated post IDs set somehow, and prepare these to save them in the database
    
        if($_POST["produkt_preis"]) {update_post_meta($post->ID, "produkt_preis", $_POST["produkt_preis"]);}
    }
    

    Replace “produkt_preis” with “associated_post_ids” or whatever.

    For maximum comfort you can add a JavaScript to the produkt_meta function which lists your posts so you just click it and the meta-field is automatically filled, but this is the part you should create on your own now 😉

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to see if anyone in the community can improve on this
I would like to associate the last installed version of my Mac OS X
I'm working a custom workflow activity and would like to allow the user to
I would like to run an executable file with a quiet execution custom action
I have a number of custom find_by_sql queries in Rails. I would like to
I would like to do the following: when a Sales person assigns a custom
I would like to leverage the IIdentity.AuthenticationType property in a custom FormsAuthentication scenario in
I would like to set a custom color for the keyboard that is associated
I would like to programatically change the data associated with a dataset in an
I would like to form a query where an associated collection has been restricted,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.