The problem is your $contenu
variable.
Try:
$contenu .= '<div class="effect-jazz">'.get_the_post_thumbnail().'<div class="jazz-try">
<div class="h3"><a href="'.get_permalink().'">'.get_the_title().'</a></div>
<p>'.get_the_resume(60).'</p><!-- THIS FUNCTION NEEDS TO BE CREATED -->
</div>
</div>';
Do not use ;
trailers when using inline php, ex <a href="'.get_permalink().'">
.
Use the appropriate return functions:
get_the_post_thumbnail()
get_permalink()
get_the_title()
- Create a
return
version ofthe_resume()
function
Do use the correct operator .=
when you wish to append to a variable, rather than overwrite it with each loop iteration.
Do not line break after $variable .= '
.
Related Posts:
- Shortcode returns escaped HTML tags
- How to write a query-function as a query-shortcode?
- ajax category filter
- WordPress 4.9.5 PHP intermittent warning trim() expects parameter 1 to be string, array given
- Last post ordered by publish date using WP_Query on front page
- Pagination custom query
- Order by two meta keys
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- WP_Query in a shortcode
- Calling a custom excerpt function in a local loop
- How to get any tag ID
- Dynamically Override Fancy Title – Part II
- query posts in functions.php and update a field
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- How to retrieve current page WP_Query arguments?
- posts_per_page not working
- Exclude admin from WP_Query Contributors
- wp_query add arguments using array_push if variable met
- Category attribute not working in custom shortcode
- Multiple Loops Inside a Function
- How to delete taxonomy term when a wordpress user is removed?
- Exclude category for main query and custom
- How to get all child pages in their parent page?
- Database Queries Optimization with new WP_Query
- Orderby is working with one query but not with other
- How to filter, restrict and return posts based on custom user meta information
- WP Query using tax_query & meta_query
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- Display most popular in the past two days
- New WP_Query calls Pre_get_posts filter twice
- Remove echo from shortcode
- Shortcode for latest -not expired- posts
- Gallery shortcode numerical sorting
- How to filter a query by date in a shortcode?
- how to access query string in wordpress?
- How should I approach changing the template & $query as part of a shortcode’s execution?
- Merge two search functions for custom post type
- Make a SQL query with wpdb in WordPress
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- Error with function in functions.php?
- Wp-query Order By problem
- Shortcode Not Working in Slider When Added To Post Title
- Return multiple values in a shortcode attribute
- Shortcode for custom query not returning results when attributes are added
- Exclude authors IDs from WP_Query
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- Loading two different AJAX requests on two different pages
- WP_query only displays one of my custom post type entries
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How to load a script code only in posts?
- Multiple meta_key ordering with pre_get_posts
- Assign a minimum result count for WooCommerce query shortcodes?
- Using a Shortcode to List Posts from Multiple Categories
- embedding shortcodes in php template
- Trying to get property of non-object in: $wp_query
- WordPress dynamic AJAX query
- relation OR instead of AND – Filtered term ID’s in loop
- How to get specific string in explode array?
- Trouble passing attribute into shortcode function
- Woocommerce Shortcode which displays a table with product data
- Pagination repeating posts on search results
- WP Query by 4 different taxonomies
- Function is printing twice – any suggestions?
- How to check if logged in user have pending custom post?
- Custom WordPress post query for displaying time-released content on website
- SEARCH QUERY PLEASE HELP | call_user_func_array() expects parameter 1 to be a valid callback php
- How to display a post(by id) along with css in a page?
- Finding post ID dynamically on click
- how to move a page from one drop down menu to another drop down menu
- How to upload 3 attachments to current post?
- Shortcode attributes causes 500 error after updating the page
- pages shortcode filtering by category
- Get post Number with local loop and template
- Seach and categories not working when ignoring sticky posts in main loop
- Query by Category and Custom Field – Shortcode
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Calling a function with WP_Query only ever brings the first result
- How to take parameters from a function and make them editable as attributes in a shortcode
- How to modify WP Query to target the first most recent post to adjust content
- Object of class WP_Query could not be converted to int inside shortcode
- How can I create another instance of my custom shortcode
- Fetching $_POST from Page Template into functions.php
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- Modify shortcode to work with custom taxonomies and slugs
- Get Current CPT taxonomy category in shortcode
- Hiding all posts/products/pages from a site based on a custom taxonomy/domain name
- return wp query results in a shortcode
- More efficient query to display posts in same sub-category?
- ordering and optimizing functions
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- Why WP_Query in functions.php is not working when get_posts works?
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- Shortcode does not display pagination [duplicate]
- Adding css tweak based on page template
- WP_Query and DES sort for Custom Taxonomy based upon a meta field?
- shortcode with $atts with strange results
- 1500+ duplicate queries via get_option function (query monitor)
- Variations as Single Products [closed]
- WP_query shortcode inside acf Repeater breaks the repeater loop
- How to prevent WP query searching in executed shortcodes