Forum Replies Created
-
AuthorPosts
-
Bottom line is:
What’s the best way to do this:
Multiple people will use the site to promote to their teams, so I want to give them a URL that will pass in a session variable, that contains a ‘user.’ Something like this:
http://domian.name/?user=falconThen there is a link on the site, that would need to populate with the ‘user’ data, so the correct registration (manual) link is generated. Like so:
https://falcon.otherdomain.name/site/
I want to populate ENFOLD theme menu, settings, with php data. Can I do that?I decided to go the cookie route with this and I wrote the following code, and placed it in functions.php. The code:
1) uses if(isset($_GET[‘user’])) to look for three GET variables that were passed in the URL, like so:
http://helium-hotspot.net/?usr=falcon&phn=720-745-1760& (Email address hidden if logged out)
2) If the Get variable isset, then the those values are set as a cookie with setcookie.
3) Else if the GET variables are empty the it sets cookies using default values.
4) lastly it creates a shortcode to place in wordpress.Everything works, but the problem is the function runs on every page and if the values arer NOT again passed on that page the default values get placed.
What I want is to set the variables one time and carry them through the website as the user navigates. Even better , have the same variables in place the next time the user visits..I understand that php wipes everything and starts fresh every time a page is loaded.What logic could I add to accomplish this?
May be what I am trying to do is more suited for placing the values in the user meta table in the database.
If GET
// SET COOKIE function set_usr_cookie() { // Get usr from URL $affiliate_user = $_GET['usr']; if(isset($_GET['usr'])) { // Set the cookie setcookie('afuser', $affiliate_user , time()+31556926); } else{ setcookie('afuser', 'falcon' , time()+31556926); } function affil_user() { // Use information stored in the cookie $current_afuser = $_COOKIE['afuser']; $string .= $current_afuser ; return $string; } // Add a shortcode add_shortcode('insert_user', 'affil_user'); } add_action('init', 'set_usr_cookie'); function set_phn_cookie() { // Get phn from URL $affiliate_phone = $_GET['phn']; if(isset($_GET['phn'])) { // Set the cookie setcookie('afphone', $affiliate_phone , time()+31556926); } else{ setcookie('afphone', '720-275-1350' , time()+31556926); } function affil_phone() { // Use information stored in the cookie $current_afphone = $_COOKIE['afphone']; $string .= $current_afphone ; return $string; } // Add a shortcode add_shortcode('insert_phone', 'affil_phone'); } add_action('init', 'set_phn_cookie'); function set_eml_cookie() { // Get eml from URL $affiliate_email = $_GET['eml']; if(isset($_GET['eml'])) { // Set the cookie setcookie('afemail', $affiliate_email , time()+31556926); } else{ setcookie('afemail', ' (Email address hidden if logged out) ' , time()+31556926); } function affil_email() { // Use information stored in the cookie $current_afemail = $_COOKIE['afemail']; $string .= $current_afemail ; return $string; } // Add a shortcode add_shortcode('insert_email', 'affil_email'); } add_action('init', 'set_eml_cookie');
I have this ask from a client too. Is there a work around, or code change that is not too extensive?
set variable on line 1058:
$sub_title = get_field(‘subtitle’, $entry );output on line 1209:
$output .= “<div class=’post-author’>{$sub_title}</div>”;
September 17, 2020 at 3:18 pm in reply to: Single post: Use advanced layout editor and place related posts at bottom #1246558Thank you this worked.
September 14, 2020 at 7:24 pm in reply to: Single post: Use advanced layout editor and place related posts at bottom #1245811Yes I tried both methods and they do not work. Could you please provide some guidance. I don’t know php (although I can often understand whats happening), I do know html and css.
What is the correct code to get and write the related posts layout (based on tags, like what you get using the classic editor).
See:
http://freshed.wpengine.com/wp-content/uploads/2020/09/Screen-Shot-2020-09-14-at-11.02.29-AM.png (hosted on WPengine)What file does the code go in?
What line should the code go on?Thank you so much!
Ishmael,
We are half finished.
Please send me off in the right direction to do the same for magazine like this:
http://freshed.wpengine.com/wp-content/uploads/2020/09/sub.jpg (hosted on WPengine)Which file do I edit?
What line?
What’s the code to display get_field(‘subtitle’, $id ) ?Thank you Ishmael,
I set the key on line 622:
$this->loop[ $key ][‘the_subtitle’] = get_field(‘subtitle’, $id );I called the key on line 471:
$items .= “<div class=’post-author’>{$the_subtitle}</div>”;July 11, 2017 at 12:17 am in reply to: Custom fonts stopped working after recent update to enfold and wordpress #819047Please take a look around and let me know what you find.
July 11, 2017 at 12:16 am in reply to: Custom fonts stopped working after recent update to enfold and wordpress #819046New ftp creds in pvt
July 11, 2017 at 12:09 am in reply to: Custom fonts stopped working after recent update to enfold and wordpress #819043July 11, 2017 at 12:08 am in reply to: Custom fonts stopped working after recent update to enfold and wordpress #819041codes in private window
Yes I did a work around. I removed the background image from the color section and re-placed them on my child theme style sheet:
@media only screen and (min-width: 768px) { #attorney-hanley { background-attachment: fixed; background-image: url("http://portersimon.com/wordpress/wp-content/uploads/Hanley2.jpg"); background-position: right top; background-repeat: no-repeat; background-size: cover !important; } #attorney-brown { background-attachment: fixed; background-image: url("http://portersimon.com/wordpress/wp-content/uploads/Brown1.jpg"); background-position: right top; background-repeat: no-repeat; background-size: cover !important; } }
Thanks Rikard,
This code does not solve the issue. I searched around a lot and tried many variations of the css before I made the post. Do you have any other insight?
I found the missing close curly bracket and the site no longer breaks but this code seems to have no effect.
When I added that code to the functions.php file in my child theme folder it broke the website. Can you check it for accuracy?
This is what I have:
add_filter('avf_logo','av_change_logo_url'); function av_change_logo_url($url) { if( is_page('certification-program') ) { $url = "http://localhost:8888/sunny/wp-content/uploads/2015/06/integraltouchinstitute_logo.png"; } if( is_page('thailand-and-bali') ) { $url = "http://localhost:8888/sunny/wp-content/uploads/2015/06/integraltouchinstitute_logo.png"; } return $url; } add_filter('avf_logo_subtext', 'kriesi_logo_addition'); function kriesi_logo_addition($sub) { if( is_page('certification-program') ) $sub .= "<img src='http://localhost:8888/sunny/wp-content/uploads/2015/06/integraltouchinstitute_logo.png' />"; } return $sub; }
This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.This reply has been marked as private.Ok I will manually reconfigure because I think you are saying there is no theme settings file. That was my question—can I get the theme settings file from Enfold 2.4.2. I think you said no.
Now I am having trouble with the general styling tab on the enfold menu. All the other tabs seem to be working fine—I can upload a logo or change header settings— but none of the changes to the colors in the general styling tab are showing up on the front end.
For example I have the footer set to a red and the footer on my site is not red:
http://vitree.com/newsite/I found the answer here:
https://kriesi.at/support/topic/adding-slideshare-to-header-social-icons/#post-200202This reply has been marked as private.Doesn’t seem to be working.
Here’s what I got starting on line 450:
if(empty($this->avia_term)) { $additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count."&orderby=rand"); } else { $catarray = explode(',', $cat); if(empty($catarray[0])) { $new_query = array("posts_per_page"=>$count,"post_type"=>$this->avia_post_type); $additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count."&orderby=rand"); } else { if($this->avia_new_query) { $new_query = $this->avia_new_query; } else $additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count."&orderby=rand"); { $new_query = array( "posts_per_page"=>$count, 'tax_query' => array( array( 'taxonomy' => $this->avia_term, 'field' => 'id', 'terms' => explode(',', $cat), 'operator' => 'IN') ) ); } } $additional_loop = new WP_Query($new_query); }
Could you please take another gander to see if I am putting in the code correctly?
This worked perfectly for lists of posts in the sidebars via widgets, the latest news widget with icon—in the sidebar on a post page.
Thank you.It does not randomize in the sidebar widget on a portfolio page. See:
http://www.boulderhardwoodfloors.com/portfolio-item/bamboo-install-sand-and-finish/
and:
http://www.boulderhardwoodfloors.com/portfolio-item/american-cherry/Can we add a little more code to make it work on a portfolio page, in addition to working on a post page?
Thank you in advance.
This might be helpful. The masonry blog on this page has a setting and is set to randomize.:
http://www.boulderhardwoodfloors.com/blog/This reply has been marked as private.I also noticed that my black WordPress dashboard strip across the top of the browser is not there when I’m logged in as an admin.
Related?April 15, 2015 at 5:21 pm in reply to: Post format "Link" links direct in latest news widgit—target="_blank" #429075This reply has been marked as private.April 12, 2015 at 12:49 am in reply to: Post format "Link" links direct in latest news widgit #427101This reply has been marked as private. -
AuthorPosts