How to create attachment page in PRO?

I followed the instructions on https://theme.co/apex/forums/topic/create-an-own-attachment-page/ but it didn’t work.

I added attachment.php to /pro-child folder
Then added wp-attachment.php to /pro-child/framework/views/ethos/ folder
And then added content-attachment.php to /pro-child/framework/views/global/ folder

Result was attachment title in header section and no content.

Do I need three files and what would be the correct content for each file?
Thanks.

Hi,

Would you mind providing us with login credentials so we can take a closer look? Please provide following information:

Set it as Secure Note

  • Link to your site
  • WordPress Admin username / password
  • FTP credentials

All the best!

Ok, thanks.

Hello There,

The given ftp does not allow us to upload any file.

The contents of the content-attachment.php file is incorrect. Please update it and use this code:

<?php

// =============================================================================
// VIEWS/GLOBAL/ATTACHMENT.PHP
// -----------------------------------------------------------------------------
// Display of attachment content.
// =============================================================================
?>

<?php do_action( 'x_before_the_content_begin' ); ?>

<div class="entry-content content">

<?php do_action( 'x_after_the_content_begin' ); ?>

  <?php the_content(); ?>
  <?php x_link_pages(); ?>

<?php do_action( 'x_before_the_content_end' ); ?>

</div>

<?php do_action( 'x_after_the_content_end' ); ?>

Please let us know if this works out for you.

Thanks for your help.
This is what I came up with:

attachment.php in /pro-child folder

<?php

// =============================================================================
// ATTACHMENT.PHP
// -----------------------------------------------------------------------------
// Handles output of attachment page.
// =============================================================================

?>

<?php x_get_view( x_get_stack(), 'wp', 'attachment' ); ?>

and wp-attachment.php in /pro-child/framework/views/ethos/ in folder

<?php

// =============================================================================
// VIEWS/ETHOS/WP-ATTACHMENT.PHP
// -----------------------------------------------------------------------------
// Single post output for Ethos.
// =============================================================================

$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );

?>

<?php get_header(); ?>
  
  <div class="x-container max width main">
    <div class="offset cf">
      <div class="<?php x_main_content_class(); ?>" role="main">

        <?php while ( have_posts() ) : the_post(); ?>
		 <?php x_get_view( 'ethos', 'content', get_post_format() ); ?>
         <?php echo wp_get_attachment_image( get_the_ID(), 'full', "", array( "class" => "img-responsive" ) ); ?>
         <?php echo do_shortcode('[vc_widget_sidebar sidebar_id="ups-sidebar-attachment-page-footer"]'); ?> 
        <?php endwhile; ?>
      </div>

    </div>
  </div>

<?php get_footer(); ?>

I didn’t understand the point of content-attachment.php in global folder, so removed it all together.

Hey There,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.