I'm trying to use WP Ultimate Search and it says:
Call the search bar with wp_ultimate_search_bar() Render the search
results area with wp_ultimate_search_results()
I tried <?php wp_ultimate_search_bar(); ?> with no luck.. any ideas?
Add both <?php echo wp_ultimate_search_bar(); ?> and <?php echo wp_ultimate_search_results(); ?> to .php file
Related
I have a Wordpress theme for a new website. I want to make some HTML adjustments but I realized that the website has only PHP scripts and of course the CSS file. For instance, I need to adjust the website name but cannot find H1 tags. I do not have any PHP knowledge. Please advice. Many thanks!
Screenshot
<?php echo "<div>html here</div>"; ?>
You can as many php chunks as you want
example :
<?php echo "<h1>html here</h2>"; ?>
<?php echo "<span>html here</span>"; ?>
Wordpress is a bit different from vanilla PHP instead of echoing out HTML with the title:
<?php echo "<h1>The Title</h1>"; ?>
It uses a function/hook called wp_title(); that you can find in header.php.
But to modify it you would have to in to functions.php and edit the function and for that you need some basic PHP knowledge.
Here is some documentation on the wp_title() function/hook.
https://developer.wordpress.org/reference/hooks/wp_title/
In html.tpl.php I have written :
<?php if($front_page):?>
<?php print 'Google+ '?>
<?php endif; ?>
but its not working moreover its hanging the home page.
Can someone please tell me the correct syntax if it has some error
Should you not be using echo instead of print?
<?php if(drupal_is_front_page()):
echo 'Google+';
endif; ?>
In most themes, you should be overriding page.tpl.php rather than html.tpl.php. You also have a couple of errors in your syntax. The typical code for a template would read:
<?php if($front_page): ?>
Google+
<?php endif; ?>
Note the space in the first line, plus you don't need to print the second.
I'm trying to customize the html print order (url http://www.yoursite.com/index.php/sales/order/print/order_id/8/ ) but I can't find the right file to do this.
I'm working on template/sales/order/print files but all the changes I made aren't visible.
could you please give me a hint?
Thanks a lot
Best regards
EDIT: ok, I've found the file that I need to modify, it is print-phtml in app/design/frontend/default/MYTEMPLATE/template/sales/order
Now I'd like to add product description in each row in this html print page, but I don't know how I can do this
There is
<?php $_items = $_order->getItemsCollection(); ?>
<?php $_count = $_items->count(); ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_item->getParentItem()) continue; ?>
<tbody>
<?php echo $this->getItemHtml($_item) ?>
</tbody>
<?php endforeach; ?>
so I think that I have to modify something in $this->getItemHtml($_item) but I have no idea where is this getItemHtml
could you please help me? thanks a lot
The file you have to edit is the \sales\order\items\renderer\default.phtml , but changes you make here will also appear on the order view page.
To avoid this, you can use the following condition in this phtml (there is also an example in the original version):
<?php if ($this->getPrintStatus()): ?>
....
<?php endif;?>
.. and for similar issues in the future: on the admin panel, in System/Configuration menu if you switch to "Store view", you will find an option under Advanced/Developer tab called "Template path hints". If you set it to "yes", you will see the template pathes in the frontend, embedded inline next to each block. How to use template path hints
Why vew helper duplicates the menu displays, though I give him a different set of data. Twice menu 'navigation1' is displayed
<?php echo $this->navigation('navigation1')->menu() ?>
<?php echo $this->navigation('navigation2')->menu() ?>
But the following code, individually, displays a different menu
<?php //echo $this->navigation('navigation1')->menu() ?>
<?php echo $this->navigation('navigation2')->menu() ?>
and
<?php echo $this->navigation('navigation1')->menu() ?>
<?php //echo $this->navigation('navigation2')->menu() ?>
Why is this happening and how can I avoid this? Thanks.
Can you post the factories and config arrays you are using to assemble the navigation? What you are showing should work fine so the issue lies in one of the other files but I would have to see them to help you.
I'ld like to insert the footer of my website dynamically so I can add it to multiply pages without copy and paste it every time.
I know an iframe can do it but I heard that's not a good solution and not working for seo.
Can it be done with PHP or JavaScript?
footer.php code as follows
<?php
//Write your custom footer here
?>
home.php code as follows
<?php
//All contents of Home page
include('footer.php');
?>
<?php include('path/to/footer.php'); ?>
PHP is the right tool for this job:
<?php include('footer.php'); ?>
from php use include function
e.g: <?php include('inc/footer.php');?>