• Resolved rudtek2

    (@rudtek2)


    How can I add the featured images of pages so they show up like they do for pages (hopefully in the title area as bg image to the page title)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Amit Singh

    (@apprimit)

    Hello,

    Unfortunately, there is no option to add featured image in pages. You need to use the child theme to do it.
    1. Install and activate the oceanwp child theme
    2. copy the oceanwp > partials > page folder into the child theme
    3. Open the files using a code editor and add the_post_thumbnail(); where you want to display image.

    Thread Starter rudtek2

    (@rudtek2)

    thanks for the quick reply!

    • This reply was modified 6 years ago by rudtek2.
    Thread Starter rudtek2

    (@rudtek2)

    There is not really any content in the 2 files in that directory. Where is the actual content part of where I could add the image?

    Amit Singh

    (@apprimit)

    Add the above function just above the the_content() function in the artcile.php file.
    Or just add the below code to the functions.php file of the child theme.

    function prefix_add_featured_image() {
        if ( is_page() ) {
            echo get_the_post_thumbnail();
        }
    }
    add_action('ocean_before_page_entry','prefix_add_featured_image');
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add featured image to pages, not just posts’ is closed to new replies.