-
AuthorPosts
-
July 12, 2014 at 3:31 pm #290506
Hi,
I am using the magazine module to show posts from a category and want to display a custom message if their are no posts found in the query. I understand, I will have to edit the magazine.php file and create in my child theme but am unsure where to edit to make this appear. Any assistance you can provide would be much appreciated
July 13, 2014 at 4:41 am #290705Hey df50!
Thank you for using the theme.
Please edit magazine.php, find this code on line 512:
if($loop !== 1 && !empty($this->atts['first_big_pos'])) $output .= "</div>"; $output .= "</div>"; } return $output;
Below, add this code:
if($loop !== 1 && !empty($this->atts['first_big_pos'])) $output .= "</div>"; $output .= "</div>"; } else { $output .= "<div class='av-magazine-group {$css}'>"; echo "My awesome message here"; $output .= "</div>"; } return $output;
Cheers!
IsmaelJuly 13, 2014 at 9:59 am #290759Hi Ismael,
Thanks for your response, great service as always. That got the function working, but it is not rendering the message in the right place
If you have a look at http://www.norths.com.au/wordpress/?page_id=40 the message appears before the rest of the content and should bve appearing on the right hand sude under Positions Available.
My magazine.php file is currently
Edited: You can use pastebin.com to show codes. :)
- This reply was modified 10 years, 5 months ago by Ismael.
July 15, 2014 at 4:54 am #291383Hi!
Thank you for the info.
Where do you like to place the message? Please give us a screenshot or the actual link to the page.
Cheers!
IsmaelJuly 15, 2014 at 5:03 am #291385Hi Ismael,
The site is now live, so can provide the actual link which is http://www.norths.com.au/about-us/employment/
On the right hand side under the heading Positions available is a magazine module. Currently there are no posts matching the query, so I would like to show a small message underneath that heading, something like ‘No jobs currently available’
Thanks
Daniel
July 15, 2014 at 5:30 am #291391Hi!
Thank you for the link.
Alright. Please replace the this line of code:
echo "My awesome message here";
with this:
echo "<div class='jobs-message'>No jobs available.</div>";
Add this on Quick CSS or custom.css:
div.jobs-message { position: absolute; bottom: 25px; }
Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.