currently, the structure of your code is like this :
<div class="text">
<div class="banner-title">post_title post_content</div>
<?php if ($apmeta['ssylka'][0] != '') {?>
<a href="..." class="button white">More</a>
<?php }?>
</div>
</div>
in order to not generate the div.text
tag, you can move the condition to obtain that :
<?php if ($apmeta['ssylka'][0] != '') {?>
<div class="text">
<div class="banner-title">post_title post_content</div>
<a href="..." class="button white">More</a>
</div>
</div>
<?php }?>
Related Posts:
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Issue with wp_get_attachment_image() and SVG file type
- deregister scripts on certain page
- Changing a function in function.php to a shortcode – for listing categories of only a certain post type
- Using get_terms for custom taxonomy in functions.php
- Formatting post content to exclude gallery
- Why do I get undefined function export_wp()?
- How to remove the embed_footer?
- Hide some items from Screen options in dashboard for products
- Editing or filtering the output of the Genesis navigation
- Function to show only first instance of shortcode
- Using the child theme functions.php to change the customizer.php on parent theme
- Can’t Update function.php after writing short code
- How to get last updated row or ID in wordpress
- Load parent theme files before child theme functions.php
- 2 Loops, Only Displaying 1 Loop in Both Loops
- edit role display name and label name without plugins
- is_plugin_active() not properly returning true
- Display gallery on top before content
- Two functions.php files in one theme
- wp_dropdown_categories and custom attribute
- Converting html to wordpress images not showing
- How can I add text to all posts/pages/categories/homepage etc
- Make parent page only link to first subpage
- Pulling Twitter RSS feed not working as expected (fatal error)
- Related post using post title
- Move Post to different category if post_meta field is 0 or is 2 days old?
- Find a Javascript ID when trying to deregister?
- Functions For Calling Specific Elements
- How to load parent theme template parts in child theme
- WordPress Page Restrict
- allow only one post in specific category
- ACF not showing
- Cannot modify header information – headers already sent (wp_redirect in functions.php)
- Javascript function not working when placed in Text Block
- Need help getting a function to function
- Load Post into DIV with Ajax
- Use html inside shortcode function
- How to remove comment count column in Posts inside the admin dashboard?
- Cannot declare function twice [closed]
- Running script based on Category
- the_posts_pagination() function returns missing page numbering on some blog pages
- Get array of metakey in all posts
- How do I hook into the container of wp_nav_menu?
- Remove links from the_content when using filters wp_trim_excerpt
- content editor format style tags
- Unable to return values from function
- Function not working inside of a function in functions.php
- How to Use Global Variables Inside Header and Footer
- Does size of a theme’s functions.php file matter?
- Redirect website domain (including all pages) to external URL after Popup message (few seconds)
- Where do I go to edit this area? [closed]
- Enable right click on WordPress site
- processing form data with ajax
- Check from functions.php if function exists in footer.php
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Email Exists ERROR into Ajax registration form
- How to overwrite template.php file
- Limit number of characters in different excerpts
- Facebook OpenGraph error, Call to undefined function wp_get_attachment_src()
- How to avoid saving empty data to sql while using add_meta_box
- How to assign php file(template) to several pages with same prefix page name/slug
- Is this a backup door?
- How to fix Function create_function() is deprecated in / themes
- Block all plug-ins from initiating redirection upon activation?
- How to display my comment count in the wordpress admin bar?
- How Can I Create a Friendly Slug for a Dynamic Page?
- custom error message for empty username and password using authenticate filter not working
- Modifying a WordPress Plugin
- Last updated posts shortcode in functions.php
- I have an fatal error on my funcyions.php
- Get post_author email for Zapier Integration
- get_locale() is different from $locale
- If click on Save/Publish change Post Status to Pending Review instead Publish
- Remove all video attachment, both files and post/postmeta from database?
- Remove the delete link from pages without a plugin
- save_post doesn’t correctly process function call with php class
- Custom download page
- HowTo: Add wrapper to columns shortcode?
- How to include a hyperlink in the body text of a custom password protected form?
- Get title from IDs in a string
- uninstall a theme programmaticlly
- Could you please correct the code is_admin()
- Dynamically generated Navigation Diagram using Custom Fields
- Update add_image_size
- Function to get the name in database table from the comma separated string
- Full size image option removing problem
- Limit length of headline in Editor
- Ajax call does not work for this custom code
- Force resize for all video content
- Way of getting queried loop before the query with a filter hook?
- Add the title of a widget as an ID – for anchor links
- Why my wp_enqueue_script doesnt work on some page?
- Need to use an external variable inside a function
- Trying to get this function to show below the content
- Correct php syntax to add an image in wp functions.php
- Get all users from role and add to dropdown (select) – wordpress, javascript
- WordPress enque the same script causes the setInterval not to work
- Override categories with Pages (block theme)
- pre_get_comments to restrict current users view of edit-comment.php to their comments