• Resolved bomdiabrasil

    (@bomdiabrasil)


    Hi,

    I use this shortcut, which works almost perfect for me:

    [display-posts image_size=”medium”? wrapper=”div”? wrapper_class=”display-posts-listing grid” meta_key=”_thumbnail_id” posts_per_page=”100″ display-posts id=”110807,110827,110847,110867,110868,110888,110908,110928,110948,110968,110988,110989,110990,110991,111011,111031,111032,111052,111072,111092,111112,111113,111133,111153,111154,111174,111194,111214,111234,111254,111255,111275,111295,62840″ ?orderby=”title” order=”ASC” title=”Züchter Hunderassen E-G”]

    I used it on this page: https://www.dogweb.de/zuechter-hunderassen-e-g/

    I would like to change the title of each post. At the moment the plugin uses the page title. I would like to change that title to a custom title by passing another array of titles.

    Is that possible? If yes, how? ??

    Thank you so much for your support.

    Best regards

    Christian

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Hi,

    Yes, you can customize the output using The Output Filter. I’m not able to write the unique code for your specific instance, but hopefully the information and instructions in that article will help you write the code.

    Thread Starter bomdiabrasil

    (@bomdiabrasil)

    Hi Bill,

    Thanks for your quick reply. I do not get it. I am not a good programmer. Might this be a solution?

    function be_dps_move_image_after_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class, $author, $category_display_text ) {
        
        // Check if "posttitle" attribute was passed, and if so, convert the titles into an array
        $manual_titles = isset($original_atts['posttitle']) ? explode(',', $original_atts['posttitle']) : array();
    
        // Determine the current post index
        $current_post_index = isset($original_atts['current_post_index']) ? intval($original_atts['current_post_index']) : -1;
    
        // If there's a manual title for this post, use it
        if($current_post_index != -1 && isset($manual_titles[$current_post_index])) {
            $title = trim($manual_titles[$current_post_index]);
        }
    
        $output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $title . $image . $date . $author . $category_display_text . $excerpt . $content . '</' . $inner_wrapper . '>';
        return $output;
    }
    

    Is it possible to hire you to change your plugin? Do you have a upwork account where I can hire you?

    Best regards,

    Christian

    • This reply was modified 1 year, 7 months ago by bomdiabrasil.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show custom post titles’ is closed to new replies.