Title: Shortcode to access div element
Last modified: August 30, 2016

---

# Shortcode to access div element

 *  [davidortiz34](https://wordpress.org/support/users/davidortiz34/)
 * (@davidortiz34)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-access-div-element/)
 * Hello,
 * I just created a shortcode where it takes the featured image from that page and
   puts it behind the content of the page as a background image. Because the shortcode
   goes something similar to this .
 *     ```
       if post has thumbnail then {
          <div class="content-wrapper wrapper">
            //shortcode here
          </div>
   
       }
       ```
   
 * The problem I’m having is I want the thumbail to target the wrapper. Instead 
   what it’s doing is just placing it inside of the wrapper div which is essentially
   inside of a container.
 * I’m not the best programmer, but I’m pretty sure I’m doing something wrong. How
   do I create a div wrapper in which the the thumbnail image would target that 
   instead. The shortcode is outputting everything correctly I don’t need help writing
   one, however inside the base.php file everything is inside of a container and
   I think that is the problem.

Viewing 1 replies (of 1 total)

 *  [Chris Huff](https://wordpress.org/support/users/brochris/)
 * (@brochris)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-access-div-element/#post-6777183)
 * I’m having a hard time visualizing from your description what you’re actually
   trying to accomplish with the code itself. Could you post what your code is outputting,
   and also what you’d like for your code to output instead?

Viewing 1 replies (of 1 total)

The topic ‘Shortcode to access div element’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [html](https://wordpress.org/support/topic-tag/html/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [style](https://wordpress.org/support/topic-tag/style/)
 * [wrapper](https://wordpress.org/support/topic-tag/wrapper/)

 * 1 reply
 * 2 participants
 * Last reply from: [Chris Huff](https://wordpress.org/support/users/brochris/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/shortcode-to-access-div-element/#post-6777183)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
