So I'm working on a wordpress theme and it's really twisted. The problem is I'm comfortable just with html and css, as I'm a code noob, so I would really appreciate your help here.
The problem here is that I want to put a tracking script and a redirect on a specific button. I'd now how to do this if I'd find the button's html form.
But when I go to the code in the page where the button is, this is the only thing showing regarding the button
<?php BookYourTravel_Theme_Utils::render_submit_button("primary-btn",
"submit-accommodation-booking", esc_html__('TRIMITE REZERVAREA',
'bookyourtravel')); ?>
BookYourTravel is the theme
I know you should maybe see all the files to know what to do, as this doesn't seem as enough info.
But I also have a functions.php file. Should I look there? Do you have any idea where should I go?
Thank you a lot. Really stuck here.
Are you writing the theme yourself or are you working with someone else's theme? If you're working on someone else's theme, I would reccommend looking into building a child theme so if you change some code, the OG theme is still there in it's entirety and if they update the theme, your code wont get destroyed in the update. There are tons of tutorials on how to set up a child theme and theres a plugin that will make it for you called Child Theme Configurator if you're not too keen on doing it yourself.
You should be super careful when you're editing functions in your theme(especially if you're new to PHP), but that's where this html is being generated. One of those functions is the thing that's generating your html. If you find where the function is held, you could probably change it so it echos the extra code you're looking to implement but it would be on every button that this function generates throughout your site.
You didn't really give enough information for us to do anything. So if you are really pulling your hair on this one just replace the old button with a new button that you wrote. I can help you out on that end if you don't know javascript.
Related
Could someone please solve a beginner's crisis for me? I simply CANNOT figure out how a plugin generates a page or even multiple pages without making a page template in the dashboard. I have read Google results and even talked to the author of this plugin I am reading through to get an idea but the way he explained it was too complex for me to understand. Here is a link in case you want to see his explanation. But I just want to understand...If a plugin is ONE PHP script, then whatever function calls the HTML template for the page must include() it right? At least that's how this plugin does it. But then why is it that when I click on one of the pages for the plugin I see this in the URL: http://www.efficientmind.org/?page_id=73. What does the ?page_id=73 mean? And how does query_vars play a part in all this? I'm so confused...Could someone maybe explain it in layman's terms and then also in a more technical so I can compare and contrast??
So I built up this Wordpress theme for my buddy. The design was already set, so I just built what I think/thought is a pretty robust template.
We've had a few issues a long the way, and the final stumbling block is the ad block on the top of the sidebar on the right hand side.
If you refresh until it displays a video, it breaks everything - not only the stuff that's below the sidebar call, but the body too.
Can anyone please give me some insight? I'm going insane. I've been working on this project for too long and just want to fix this final problem.
http://www.touchlinetalk.com/
Uh, help!?
Your code is not valid (check with http://validator.w3.org/). A lot of elements are not closed, overlapping, some anchors are not closed, etc. Adding your video probably introduces a new div element or something like this, which actually interfers with the overlapping other elements you have in your page and breaks the layout. You should give a link to the page that does not work (call it "proof of concept") and not to a page that is OK.
If you are using WordPress, here is a really handy function for you, to avoid non-closed tags: force_balance_tags(). It closes tags that havent been closed. More info here: http://codex.wordpress.org/Function_Reference/force_balance_tags
I'm trying to integrate a form like this into Wordpress
This form works perfectly with the PayPal API sandbox. However, when I tried to move this work over to the WP site of my organization, globalcitizenyear.org/donate/donation-form-2/, I keep coming up short.
Anyone have any tips to keep in mind when doing this? What steps would you take first to make this happen in Wordpress - any details on what to avoid, or what potential hangups might be?
Make a page called page-donation-form-2.php and load this code into it. You can leave in the get_header() and get_footer() tags if you want to have the site wrapper around the outside.
Make sure to change your form action also. And remember, that since this is in WordPress now, you will need to avoid some reserved form elements. Full list here.
If you have any trouble, please post your code here.
I am very new to WordPress, so I would appreciate some help.
I am using WordPress as a CMS, and I am trying to make the thing work so that when I select a page to edit, there is a special box where I can input PHP code that will execute on my page.
I have found the PHP exec plugin, which works perfectly, but I would like to keep the code out of my main text editor, out of the way of my client's careless fingers.
Any suggestions would be very, very appreciated. Thanks!
You could create a template for each one, and include your PHP there.
Simply select the template from the page edit page.
But if you are only including a little PHP per page, you could get the slug via WordPress in your page template and act on it accordingly.
You can also add an extra meta box on the post editor page, only visible to you, with a textarea where you can add the code. You would save it as a meta field of the post. Your template can check for the existence of this field, and execute it if found.
PHP Exec is the best plugin I have found, and I looked long and hard for that one. The problem with doing it as you suggest is that if the PHP code displays an item on the page, it still has to be formatted within the page as well. It is a simple logistical problem, but somewhat of a complex coding problem. I haven't been able to get around to working on creating a better plugin for it.
In my Wordpress-powered website (http://onomadesign.com/wordpress/identity-design/usx-corporation/ for example) I want the sidebar.php, the thumbnail navigation on the right, NOT to reload when people click another project. So that they not get lost in navigation.
Now, I have looked at iframes, jQuery cookies, 'AHAH-method', php sessions.. but I can't find an easy way to do this.
I am defenitely not a programming expert, could someone give me an easy solution for this?
Thanks a lot in advance!
IFrames or AJAX are the only two options you have. (I suppose unless you did full screen flash) Everything else is going to reload the page. Ahh those other technologies you mentioned do not address the problem of reloading the main page (except iframes)
It isn't really going to be "straight-forward", but what you're trying to do isn't straight forward. I really recommend you take a look at jQuery and how AJAX works, it's probably the better of the options all things considered.
There are a few Wordpress plugins that attempt to implement this functionality. I haven't used any, so I'm not sure if they completely avoid reloading the sidebar, but it's worth a shot. One in particular that seems fairly well scored would be http://ajaxedwp.com/ I found this plugin by going to the "Add New" plugins page in the Wordpress Admin panel and searching for "AJAX Page Load".