Forum Replies Created
-
AuthorPosts
-
December 9, 2019 at 4:49 pm in reply to: If / Else statement to ternary condition for input into postslider.php #1164074
Ismael,
The ternary operator worked. They are actually easier than if / else once you get your head around them. :)
Thanks
Tim
Noice,
I’ll take a look.
Thanks
TJ
Cool,
Thanks everyone for the pointers so far. Managed to remove the dates and add in my custom field data instead. Found another date I want gone though. The ajax search from the menu also displays a date.
Which php file needs tweaking?Thanks
TJ
Hi,
I too have run into issues with with security headers and the use of ‘self.’ I’m guessing it is WordPress related and not theme as I also run sites built on Avada and the same happens. Using the ‘self’ in CSP for some reason blocks internal assets. Adding ‘unsafe-inline’ does work but defeats the object of setting the headers.
I’ve set my CSP to report only while I compile the policies. Here’s what i have below for allowing Google if you need them. I’m setting mine via php rather than htaccess.
header("Content-Security-Policy-Report-Only: default-src 'self' https:; script-src 'self' 'unsafe-inline' ajax.googleapis.com www.google-analytics.com www.google.com www.gstatic.com maps.googleapis.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; font-src data: fonts.gstatic.com 'self'; img-src data: www.google-analytics.com 'self' secure.gravatar.com"); // FF 23+ Chrome 25+ Safari 7+ Opera 19+ header("X-Content-Security-Policy-Report-Only: default-src 'self' https:; script-src 'self' 'unsafe-inline' ajax.googleapis.com www.google-analytics.com www.google.com www.gstatic.com maps.googleapis.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; font-src data: fonts.gstatic.com 'self'; img-src data: www.google-analytics.com 'self' secure.gravatar.com"); // IE 10+
Hopefully the ‘self’ issue will get resolved.
Thanks
TJ
Hi,
Adding theme shortcodes inside other theme shortcodes can have unexpected outcomes but it is possible to do.
In order to view the shortcode output you need to turn on debug mode
Once turned on add a page and create your gallery using the layer builder. We are only using this page to get and copy the shortcode it won’t be a live page. You’ll notice the shortcode is populated towards the bottom of the page. It will look like this…
[av_gallery ids='' style='thumbnails' preview_size='portfolio' crop_big_preview_thumbnail='yes' thumb_size='portfolio' columns='5' imagelink='5' lazyload='avia_lazyload' av-desktop-hide='' av-medium-hide='' av-small-hide='' av-mini-hide='']
Copy it. Now on your actual page create an accordian and paste the gallery shortcode into it. It will look something like this…
[av_toggle_container initial='0' mode='accordion' sort='' custom_class='']
[av_toggle title='Toggle 1' tags='' custom_id='']
paste your content here
[/av_toggle]
[av_toggle title='Toggle 2' tags='' custom_id='']
paste your content here
[/av_toggle]
[/av_toggle_container]Be super careful as the debug panel can break everything if used incorrectly. Once you get to know the shortcodes you can code straight into the debug panel but that isn’t advisable.
Hope that makes sense and helps a little.
Thanks
TJ
Hi,
The main support page shows the last person to comment was Rikard but no comment is seen on the thread?
Thanks
Tim
Hi Victoria,
That would make sense :’)
**UPDATE**
The RSS feed widgets isn’t found in there. The widget is this one in the backend…
And out puts a post title, date and author. I wish to add my custom field to the output.
Thanks
TJ
- This reply was modified 5 years, 1 month ago by tjswarbs78.
Hi,
index-loop.php did the trick. Custom Field now shows in the blog meta.
How about the rss widget?Thanks
TJ
Ah,
Worth a try I’ll just keep reviving this topic when I need to ask.I’m using the Multi Author Blog layout and want to tweak the meta info that appears and add a custom field (see image below)
Which php file needs tweaking?
I’m also after adding the same custom field to the rss widget. Which php file needs tweaking?
Can’t screen shot that as contains sensitive info.Thanks
Tim
Hi,
If you mean the AJAX search you can use some css to hide it.
#top div .ajax_search_entry_view_all {display:none;}
Adding that to your quick css / custom css should sort the problem.
Hope that helps
TJ
- This reply was modified 5 years, 2 months ago by tjswarbs78.
Hi,
One more quesion and then it can be closed.
Can /config-templatebuilder/avia-shortcodes/postslider.php be placed inside the child theme rather than editing the main theme file?
Thanks
Tim
Hi Ismael,
That’s the same code i originally tried but didn’t work…
$cptlink = get_post_meta($post->ID, 'linkedinurl', true); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add} {$cptlink}</a></div><div class='slide-meta-del'>/</div>";
The code you supplied does work but they look identical to me! The CF pulls through correctly.
As always you’ve done first class support. 5 stars mateThanks
TJ
I photoshopped it out so no one on here could read it. The issue isn’t because of the excerpt or content. I know what i want is possible because like i said i can get plain text to appear where i want. The problem is if i paste various pieces of code the out put breaks, so I must not be using the correct code.
To add a CF in standard wordpress theme you use
<?php echo get_post_meta($post->ID, 'Mood', true); ?>
Pasting that into the postslider.php just returns errors
Notice: Undefined variable: post in /config-templatebuilder/avia-shortcodes/postslider.php on line 575
Notice: Trying to get property of non-object in config-templatebuilder/avia-shortcodes/postslider.php on line 575
I’m not sure how to translate that first bit of code so it outputs the CF.
Thanks
TJ
Hi,
The post has both an excerpt and content, I just removed it for the purpose of the image. I can change the code and get some plain text showing but any php changes just echo the code to the page rather than pulling the customer field info. I’ll try $the_id and see what happens with that.
The info is against a customer post type called staff rather than a standard post / page does that matter?
Thanks
TJ
Hi all,
I’ve only just got back to this after 7 months and I need some help.
I know from Dude’s reply I’m in the right place and I’ve found the code that I need to tweak. This has been confirmed by sticking some text in there that does show in blog grid meta.
Code to tweak
if($show_meta && !empty($excerpt)) { $meta = "<div class='slide-meta'>"; if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add}</a><p>TEST</p></div><div class='slide-meta-del'>/</div>"; } $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)); $meta .= "<time class='slide-meta-time updated' $markup>" .get_the_time(get_option('date_format'), $the_id)."</time>"; $meta .= "</div>"; if( strpos($blogstyle, 'elegant-blog') === false ) { $output .= $meta; $meta = ""; }
Result
Nice one, stage one complete.
Stage two is to get the custom field data to show where TEST is and this is where I’m coming unstuck.
No matter which code I use the custom field data doens’t show. I’ve tried various formats of the code and none work.
See examples below….if($show_meta && !empty($excerpt)) { $meta = "<div class='slide-meta'>"; if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $cptlink = get_post_meta( get_the_ID(), 'linkedinurl', true); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add} {$cptlink}</a></div><div class='slide-meta-del'>/</div>"; }
if($show_meta && !empty($excerpt)) { $meta = "<div class='slide-meta'>"; if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $cptlink = get_post_meta($post->ID, 'linkedinurl', true); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add} {$cptlink}</a></div><div class='slide-meta-del'>/</div>"; }
if($show_meta && !empty($excerpt)) { $meta = "<div class='slide-meta'>"; if ( $commentCount != "0" || comments_open($the_id) && $entry->post_type != 'portfolio') { $link_add = $commentCount === "0" ? "#respond" : "#comments"; $text_add = $commentCount === "1" ? __('Comment', 'avia_framework' ) : __('Comments', 'avia_framework' ); $meta .= "<div class='slide-meta-comments'><a href='{$link}{$link_add}'>{$commentCount} {$text_add} </a><?php echo get_post_meta($post->ID, 'linkedinurl', true); ?></div><div class='slide-meta-del'>/</div>"; }
So the question is how can I get data from the custom field called ‘linkedinurl’ to show?
The custom field is on a custom post type does that matter? A little help pointing me in the right direction would be super :)Thanks
Tim
Hi all,
My main menu is a heavy customised Ubermenu with images, icons, description none of which look right on mobile. Yes i could use css to completely restyle the menu and hide things and show other things but a neater way would be to output a different menu on mobile. A simpler and more mobile friendly one with less menu items.
The following code
if ( wp_is_mobile() ) { wp_nav_menu( array( 'theme_location' => 'mobile-menu' ) ); }
does half a job. It adds an extra menu above the header on mobile. I need to know where the call is made for the menu that appears in the buger menu so i can replace that.
Thanks
Tim
Hi,
That link works for displaying a different menu somewhere on the page, why didn’t they just use the sub-menu element?
I want to change the mobile menu call so a different menu is displayed in reference to this post.
Show my ubermenu unless on mobile then display another.
Thanks
Tim
Hi,
If you are just after the dates that appear on the search page and in the Ajax search you can hide them using css.
.search .post-meta-infos { display: none!important; }
That should hide the meta info on the search page only. It will remain on blogs and blog elements.
.header_color .ajax_search_excerpt { display:none; }
That will remove the info from the Ajax search
In order to remove them from the site completely you’ll need to edit some of the php files (I’ll get back to you soon over which ones) you could just change the “published” date in the backend to make them appear newer.
Hope that helps
TJ
- This reply was modified 5 years, 6 months ago by tjswarbs78.
Hi,
It would appear there is some padding on the header that is pushing the main content down.
.html_header_top.html_header_sticky #top #wrap_all #main { padding-top: 159px; }
Adding that closes the gap on all pages. It does slightly move the content on the main page (where there is no colored bar) up by about 4px
The code can be added to the quick css panel.Hope that helps
TJ
Hey,
You can use a codeblock inside a colorsection to display an iframe.
For example google maps or youtube videso can be embedded via an iframe this way.
Embedded another website inside yours is not best practice and could be seen as phishing.
Most sties will have X-Frame-Options: DENY as a HTTP response header that stops their site being embedded via an iframe.Hope that helps a little
TJ
Hey Ismael,
I’ll remove the var statement part and see what happens.
Is there a way to and more click functions to that code for other buttons? like below..
function superpowers_script_event(){ ?> <script> jQuery('.powers-btn-1 a').click(function(){ ga('send', 'event', { eventCategory: 'superpowers', eventAction: 'download', eventLabel: 'joinedup', eventValue: 1}); }); jQuery('.powers-btn-2 a').click(function(){ ga('send', 'event', { eventCategory: 'superpowers', eventAction: 'download', eventLabel: 'joinedup', eventValue: 1}); }); </script> <?php } add_action('wp_footer', 'superpowers_script_event');
I only need to load one function then rather than multiple. Would the above work? Is there a neater way to do it?
Again i know this is way off theme support so no rush :)Thanks
TJ
Boom!! Exactly what I needed :)
Thanks
TJ
(can be closed)
Hi,
I’m currently using css to hide the meta info (see first post).
What I then want to do is add in some info from a custom field, hence wanting to get at the php.I’m using the blog post element, rather than the team member section as I prefer the functionality. In the backend staff is a custom post type that the blog post element then pulls to the live page and displays in the grid layout. I have added a custom field to each “staff” which I then want to display in place of the meta info.
Thanks
TJ
Hi Mike.
Does that create the look on the live page or just the look and function of the element on the AviaBuilder canvas?
For example in the loop-index.php you can change the code
echo $title; echo "<span class='post-meta-infos'>"; echo "<time class='date-container minor-meta updated' >".get_the_time(get_option('date_format'))."</time>"; echo "<span class='text-sep text-sep-date'>/</span>"; if ( get_comments_number() != "0" || comments_open() ){ echo "<span class='comment-container minor-meta'>"; comments_popup_link( "0 ".__('Comments','avia_framework'), "1 ".__('Comment' ,'avia_framework'), "% ".__('Comments','avia_framework'),'comments-link', "".__('Comments Disabled','avia_framework')); echo "</span>"; echo "<span class='text-sep text-sep-comment'>/</span>"; }
to remove or add things to the meta info. That only seems to work on the single post page though. I can’t find anything similar in the blog.php mentioned.
Thanks
TJ
Hi,
Which php template is responsible for the blog post element? More specifically where is the php loop that controls the meta info? Currently it looks for post count and date of a post. I can tweak that to show a Custom field instead once I know where it is.Thanks
TJ
EDIT.
I have found that loop-index.php can be tweaked to replace meta info on a single post page.
Still can’t find which php file outputs the blog post element.- This reply was modified 6 years, 3 months ago by tjswarbs78.
Hi,
It doesn’t look like any external .css files have been used then linked to.
It’s best practice to add any external resources to the header and none have been. They’d appear around line 14.If you right click and go to view source… all that crap at the top from line 33 to 97 are the various resources loading. They all look standard.
If you go to line 117 there is some css there that looks like this
#top #header_main > .container, #top #header_main > .container .main_menu .av-main-nav > li > a, #top #header_main #menu-item-shop .cart_dropdown_link{ height:102px; line-height: 102px; } .html_top_nav_header .av-logo-container{ height:102px; } .html_header_top.html_header_sticky #top #wrap_all #main{ padding-top:152px; }
Has that been copied over do you know?
There also hasn’t been any css added to the custom.css file (line 91)
Any clues / hints as to what looks different? That might help narrow things down
Thanks
TJ
Hey,
How very odd.
Have you set comments to be moderated under “Discussion Settings”? (or via a plugin)
It could be another setting in there maybe blocking them?Is it possible to post a link to the page in question?
Thanks
TJ
August 29, 2018 at 4:39 pm in reply to: Apply CSS to full width submenu ONLY when it goes sticky #1003215Hey Scott.
You are correct, there is no class change once the menu hits the top of the page. There is a position change from absolute to fixed which is done via .jsYou can find the avia.js file by going to appearance > editor.
Make sure the “theme to edit” is the Enfold parent and scroll down until you see .js under the “Theme Files” tree.It can also be found via ftp at wp-content>themes>enfold>js
The lines for the css change are 1349 to 1377The entire function for sticky sub menu starts at 1318 and ends at 1459
Ways to make changes that persist after updates?
Create a child theme and make change to avia.js in there or the functions.php
Hope that help a little
TJ
August 29, 2018 at 3:57 pm in reply to: Missing Cross-Origin Resource Sharing (CORS) Response Header #1003202Hi,
Is it possible to post a link to the site question?
I’ve helped a number of people with mixed / cross content issues and may be able to shed some light.Thanks
TJ
Don’t know why I didn’t think of this before…. I could use a Custom Field.
How would I get the info in the Custom Field to replace the meta info in the Blog Post element on a specific page?I’ll have a play about but if someone comes up with an answer please post it :()
Thanks
TJ
-
AuthorPosts