JonWright
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Show Posts] Sort posts by modified dateMy bad, should have looked there. Thank you.
@jamesosborne Thank you, that has cracked it.
Forum: Themes and Templates
In reply to: [Customizr] Adding the word 'Comment/s' to the comments bubble@electricfeet – share the love, as you, @acub and @rdellconsulting have all helped me out in the recent past as well. Thank you.
Forum: Themes and Templates
In reply to: [Customizr] Adding the word 'Comment/s' to the comments bubbleFabulous that’s exactly what I was after, thanks @nikeo
Thank you for creating such a great theme, I’ve used lots and this is the best one by far, super flexible and great support from all the forum members.
Forum: Themes and Templates
In reply to: [Customizr] Remove Nav Bar boxFab, that’s fixed it. Thanks
The section I was referring to in the guide is here btw:
https://www.themesandco.com/customizr/customizr-navbar-guide/
the section headed ‘Hiding the nav bar box’
That’s absolutely fantastic acub. Thank you so much for your help.
@acub – yes there are more than a few gaps in my CSS knowledge ?? but I was figuring it would be better to do via tweaking the PHP script.
Anyway, re not displaying when field is empty. Your right I don’t know PHP but I can see your solution does what I’m after but I don’t understand how I merge what you did with the script I have written.
The reason I didn’t use your script was because i could not see how I added more than one custom field. whereas the one written by electricfeet was easier for me to understand in that regard.
Forum: Themes and Templates
In reply to: [Customizr] Search results page showing excerpts not full postsmarking as resolved
Forum: Themes and Templates
In reply to: [Customizr] Search results page showing excerpts not full posts@electricfeet – i’ve worked it out. It is the plugin I’m using that is forcing the excerpt behaviour.
I have now got around the issue by changing the way the plugin works.
Thanks for your help as always.
@electricfeet & @acub thank you both I am getting somewhere with this now. Couple of issues though.
I have 3 custom fields I want to display; price, website & related_posts. And I want them to appear after the post title. I have this part working now thanks to your help.
My code now looks like this:
/**This adds custom fields to my pages*/ add_action ( '__after_content_title' , 'price' ); function price() { // Get custom field data for price $custom_field_data = get_post_meta(get_the_ID(), 'price', true); echo '<span class="price-label">Price: </span><span class="price">' . $custom_field_data . '</span>'; } add_action ( '__after_content_title' , 'website' ); function website() { // Get custom field data for website $custom_field_data = get_post_meta(get_the_ID(), 'website', true); echo '<span class="website-label">Website: </span><span class="website">' . $custom_field_data . '</span>'; }add_action ( '__after_content_title' , 'related_posts' ); function related_posts() { // Get custom field data for related_posts $custom_field_data = get_post_meta(get_the_ID(), 'related_posts', true); echo '<span class="related_posts-label">Related Posts: </span><span class="related_posts">' . $custom_field_data . '</span>'; }
I have three issues though:
1) The all appear inline i.e. price:$199website: https://www.awebsite.com Related Posts: https://www.arelatedpost.com
How do I make them so they each wrap onto a new line? e.g.
Price:$199
Website: https://www.awebsite.com
Related Posts: https://www.arelatedpost.com2) The labels appear across all my posts and pages even when I have not added a custom field to the post/page in question. How do I make it so that the labels only appear when I have added the custom field/s to a particular post/page?
3) When one of my custom field values is a URL it is formatting as text not as URLs. How do I fix that?
If you want to see what I mean here’s one of my posts that does have custom fields https://ongrowthhacking.com/reviews/custom-post/ and here’s one of my posts that doesn’t https://ongrowthhacking.com/hello-world/
Thank you
Forum: Themes and Templates
In reply to: [Customizr] Search results page showing excerpts not full postsHi – site is https://www.ongrowthhacking.com and you want the ‘Tools of the trade’ tab.
I am using a plugin on the left that filters the results. so maybe it’s forcing the use of excerpts rather than customizr.
@electricfeet follow up related question. If I forget about the plugin and just use the standard custom fields in wordpress, where/how would I add those to my child theme such that they appear below my post title?
Thanks for the help ElectricFeet
Marking as resolved.
Thanks for this Harmony Webworks in the end, rather than add all this code I used a plugin called Blog In Blog which allows me to do what I want.
I may end up changing this and coding with your suggestion, but for now the plugin offers various other features which are saving me time.