I have got a Wiki, with multiple languages, and a custom Skin. My Sidebar is 100% custom-made. I want to get the Language box in there. If someone uses this markup:
[[iwcode:Pagename]]
I want the link and corresponding Language name to pop up in there. How do i get it into my HTML code?
Please help me!
Best regards,
Max
Inside your skin class, yuou should have access to the iw links through $this->data['language_urls']. If you want the links in your sidebar, you can just copy the code from the other skins:
echo "<ul>";
foreach ( $this->data['language_urls'] as $key => $langLink ) {
echo $this->makeListItem( $key, $langLink );
}
echo "</ul>";
Related
I am using woocommerce on my wordpress website and I want to merge the description and additional information tabs on the product pages. I want to place the content of both tabs underneath eachother. Note that there is a similar question (with answer) posted here: Merge Description and additional information tab in Woocommerce
However, this answer places the content of the tabs in two columns instead of underneath eachother. I tried using this answer and tweaking it in order to get the contents to show underneath eachother, but my knowledge of html and css is not sufficient enough to solve this problem (I am new to coding, and even though I am proud to say that I managed to do some edits and minor fixes, this problem is definitely out of my league...)
Is there anyone who could help me out?
Thanks in advance! :)
I found out a simple way to do this. (review would be great!) The content shown in description and additional information tabs is extracted from the database and displayed in these files:
theme/woocommerce/single-product/description.php
theme/woocommerce/single-product/additional-information.php
By copying the following code of additional-information.php to description.php the content of the two are merged into one tab.
global $product;
$heading = esc_html( apply_filters(
'woocommerce_product_additional_information_heading', __( 'Specification',
'rehub_framework' ) ) );
?>
<?php if ( $heading ) : ?>
<div class="rh-woo-section-title"><h2 class="mt0"><?php echo ''.$heading; ?
>: <span class="rh-woo-section-sub"><?php the_title();?></span></h2></div>
<?php endif; ?>
<?php do_action( 'woocommerce_product_additional_information', $product ); ?>
I need to add a shadow effect png picture to the top banner in my Magento website tamween.biz, I could do this on my local server using firebug by adding a new class in the right coding area and I have made all selector properties in the bootstrap.css file.
This test was very successful, The problem is I don't know where to locate the real HTML file in the server to edit these changes?
HTML code that calls image is in root/app/design/frontend/<package>/<theme>/template/page/html/header.phtml
Image's path is stored in System => Configuration => General => Design => Header => Logo Image Src
Any skin is located in root/skin/frontend/<package>/<theme>/css
Magento HTML page is made up of blocks, and each block has a template file.
To find out where each block template file is you can add some code to the core and get rid of it after you are done.
Open app/code/core/Mage/Core/Block/Template.php:241. This should be in the method fetchView and then edit the line having the include code to the following
if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) {
echo "<!-- template hint start\n";
echo $includeFilePath."\n";
echo get_class($this)."\n";
echo "-->";
include $includeFilePath;
echo "<!-- template hint end\n";
echo $includeFilePath."\n";
echo get_class($this)."\n";
echo "-->";
} else {
This will add HTML comments telling you about the template file path and what $this means in that context.
(Reference)
In magento go to System - > configuration and set template hints yes.
This way you will see each template section from where static blocks will come from.
If you have created your custom theme then go to
root/app/design/frontend//yourtheme/template/page/html/header.phtml
if not then go to
root/app/design/frontend/base/default/template/page/html/header.phtml
and the n search for
<img src="<?php echo $this->getLogoSrc() ?>">
this is the code that output the image.you can add css class to it.
I am trying to create a Wordpress template from static HTML that I made a while back. In the HTML there is a <span> tag within each link in the main navigation menu. It looks like this:
https://www.dropbox.com/s/52zgm8kpj8cfb51/Screenshot%202014-08-25%2018.35.47.png?dl=0
The span accounts for the small tab-like extension to the left of the links. This is to give the page a three-dimensional effect. Unfortunately, when I converted the HTML to a Wordpress theme, I was not able to find how to do this whilst making use of Wordpress' dynamic menu function. This creates the links automatically and generates the HTML. I was wondering if anyone knew a way in which I could edit the generated hyperlinks to include the <span> tag.
Assuming you're using the wp_nav_menu() function to generate the menu links, I believe the code you're looking for is:
<?php
$defaults = array(
'link_before' => '<span>',
'link_after' => '</span>'
);
wp_nav_menu( $defaults );
?>
http://codex.wordpress.org/Function_Reference/wp_nav_menu
I created my event pages with a different website. That website generated an html page for me(with Javascript, CSS hosted at their end) each time I created an event. I would like to embed the event pages into my website. In order to achieve, I tried to create a blank page template like below:
<?php
/**
* Template Name: Blank
*
*/
if (have_posts()) {
while (have_posts()) { the_post();
the_content();
}
}
?>
Then pasted the content (including head and body) into WYSIWYG editor. However, WordPress pushes everything into body. How can I create a pure blank page template and have the ability to edit everything with WYSIWYG?
Not quite sure if this is the best way to solve your problem. If I understand correctly you want to include events from website X in a page on website Y?
Assuming you set up events as a custom post type, you could use an 'event' RSS feed on website X: http://www.website-x/feed/?post_type=event
Then, on website Y reed the feed using:
$content = file_get_contents('http://www.wesite-x/feed/?post_type=event');
$x = new SimpleXmlElement($content);
foreach($x->channel->item as $entry)
{
$title = $entry->title;
//ETC...
}
It's not wysiwyg but it well get you all the content you need, and you can do whatever you want with it.
Hope this helps.
I am updating my portfolio website and require a different sidebar for different ties of pages, i.e. one for work page and one for the blog page, apparently this can be done using Custom Fields in the page or post.
So, I opened up single.php and found the following code
<?php get_sidebar(); ?>
And replaced it with the code below
<?php $sidebar = get_post_meta($post->ID, "sidebar", true);
get_sidebar($sidebar);
?>
To add a custom sidebar, all I need to do now is apparently add the custom field “Sidebar” and include the name of the sidebar file. For example if I insert “page-01”, it will display sidebar-page-01.php as your sidebar.
After multiple times of trying however this 'isn't' the case, can't see anything wrong with what I am doing, any one have any ideas? Any help would be greatly appreciated!
Thanks guys!
You can do this the way you are doing it by doing your own php function and target the page you need with
<?php
if ( is_home() ) :
get_sidebar( 'home' );
elseif ( is_portfolio page1() ) :
get_sidebar( 'portfolio page sidebar' );
else :
get_sidebar();
endif;
?>
add more elseif statements for as many page & sidebar combination you will have
or you can download this plugin and use the code above the same way