• Resolved johndoe01

    (@johndoe01)


    Greetings.
    I noticed that in the default template of add-preview the title of the ad which i ma previewing is not visible.

    I”m trying as well on a custom add-preview file but i can’t retrieve such title.
    Is there a way to add the title (which i filled on the form) for the preview?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    one way to do that would be to create an add-preview.php child template as explained here https://wpadverts.com/doc/child-themes-and-templates/ and in your custom add-preview.php file add the below code

    
    <?php
    echo sprintf( "<h2>%s</h2>", get_the_title( $post_id ) );
    include ADVERTS_PATH . "/templates/add-preview.php";
    
    Thread Starter johndoe01

    (@johndoe01)

    Hello Greg.

    Thanks, it worked. I did a slight variation.
    Since my custom add-preview.php calls a single-custom.php i sent the first line inside in the designated place and worked as intended.

    If i see something odd i’ll let you know.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Ad Title on Preview’ is closed to new replies.