Trying to create shortcode listing custom posts, but formating not being included
the_title() and the_content() both include an echo. You want to build a string, so use get_the_title and get_the_content instead.
the_title() and the_content() both include an echo. You want to build a string, so use get_the_title and get_the_content instead.
From your screenshot, it looks like you are displaying images from another website (nga.gov), for example: http://images.nga.gov/?service=asset&action=show_preview&asset=120079 After checking out the links with the mixed content warning, I can see that SSL is set up for this website, which is good. However, their links still default to HTTP, for whatever reason. To fix this on … Read more
Try running the post content through the do_shortcode() function before displaying it. $args = array(‘posts_per_page’ => -1,’post_type’ => ‘edge’); $edge_array = get_posts( $args ); foreach($edge_array as $e): echo do_shortcode($e->post_content); endforeach;
You could modify the servers htaccess file. Try this: # This will redirect a subdomain to another domain RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC] RewriteRule ^(.*) http://shop.newdomain.com/$1 [L,R] This should redirect anyone from the www. to the shop. domain.
All other things being equal, your page file “page-projets.php” will display a page with a slug = “projets”. So… what is the contents of that page?
Doesn’t sound like you’re doing anything wrong but can’t really assist without more information. I’m thinking it’s either a theme, plugin, or server issue. First try disabling the cherry lazy load / parallax plugins to see if it is coming from there. Then try changing your theme to see if you have the same problem … Read more
Your orderby is wrong and should be $args = array( ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘cat’ => $category->cat_ID, ‘paged’ => $paged, ‘meta_key’ => ‘featured_blog’, ‘orderby’ => array(‘meta_value_num’ => ‘DESC’, ‘date’ => ‘DESC’ ), );
You can conditionally check for a page with is_page so that the woo_custom_order_button_text function only returns for whichever page you specify: // When any single Page is being displayed. is_page(); // When Page 42 (ID) is being displayed. is_page( 42 ); // When the Page with a post_title of “Contact” is being displayed. is_page( ‘Contact’ … Read more
You should change your get_posts to WP_Query. You are making a lot of queries because you’re running setup_postdata is running its own set of queries to get the post data from the posts you got through get_posts. This can be avoided by using WP_Query instead. Based on your code, you should have something like this … Read more
You target mobile in CSS based on the display width, like this: @media only screen and (max-width: 768px) { // Mobile-specific CSS here } And then, depending on your code or theme, something like this for the actual CSS: img { display: block; margin: 0 auto; }