Merge description & additional information tab in woocommerce - html

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 ); ?>

Related

ACF fields in another plugin

I need to add additional images next to post title, in this case decided to use ACF and add fields (image) into another plugin (Event Schedule). After I added fields in ACF I was trying to add some code from ACF documention however it doesnt work..
P.S. Every post will have different images based on their type. You can choose it while you are editing specific post.
In ACF field menu I chose to return format Image Array.
Tried with all return formats: Image Array, Image URL and Image ID. As I understand plugin cant find the variable acf_name and the image source is left blank.
<div class="wcs-class__meta">
<div class="wcs-class__inner-flex">
<h3 class="wcs-class__title" :title="event.title" v-html="event.title"></h3>
// Using this code from official ACF documentation
<?php
$acf_name= get_field('acf_name');
if( !empty($acf_name) ): ?>
<img src="<?php echo $acf_name['url']; ?>" alt="<?php echo $acf_name['alt']; ?>" />
<?php endif; ?>
</div>
</div>
Now nothing happens, no errors, nothing. However, also it doesnt show those images I want.
Files in the plugins folder do not have access to global functions like get_field();. You can overwrite most plugin files in your theme, in which you should have access to global functions. Keep in mind that when the plugin you override gets updated, the file your are overriding will not. This could cause security issues.
The following article talks about the right ways of custmizing plugins: https://iandunn.name/2014/01/10/the-right-way-to-customize-a-wordpress-plugin/

Custom Skin: How to get Languages into MediaWiki Sidebar?

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>";

Wordpress Custom Sidebar

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

Can't seem to widgetize a sidebar for a custom Wordpress theme

I was brought in to make a quick Wordpress theme for a client's existing site. Using the existing site's CSS and JS, and skeleton HTML, I was able to get the theme working in virtually every way except some. For starters, I can't seem to 'widgetize' the sidebar.
The HTML for the sidebar, before attempting to register for widgets, was as follows:
<div class="wms-column wms-column-nav">
<div class="wms-column-nav-body">
<h2>Blog</h2>
</div>
</div>
Bear in mind that I can add html inside of the inner div, but I cannot change the two outer divs. They must remain.
After reading http://codex.wordpress.org/Widgetizing_Themes and trying several examples, I get nothing but errors. Naturally, the widget area therefore refuses to show in Dashboard > Appearances.
How do I convert the above code to function as a widget-accepting sidebar? Is having id="sidebar" necessary? And are titles needed? The Codex page seems to imply the way you format the titles depends on the overall approach (example: divs vs. lists). The impression I am getting is that you're making a template that the widgets use over and over to kick out content. I figured you just were telling WP where to put widgets (and all of their content / format / intricacies were handling in the widget's code).
Widgetizing a theme a basically two steps.
Register your sidebar
Add the registered sidebar to the theme
In functions.php
From the Codex page for register_sidebar;
register_sidebar(array(
'name' => __( 'Right Hand Sidebar' ),
'id' => 'right-sidebar',
'description' => __( 'Widgets in this area will be shown on the right-hand side.' ),
'before_title' => '<h1>',
'after_title' => '</h1>'
));
In your theme template(s)
Add a call to dynamic_sidebar. This would probably be in sidebar.php
<div class="wms-column wms-column-nav">
<div class="wms-column-nav-body"><?php
dynamic_sidebar( 'right-sidebar' ); // your widgets will go here ?>
</div>
</div>
Notice that the parameter used in dynamic_sidebar matches the id used when registering the sidebar. That should be it. Of course, implementations can be more complicated-- including for example a hard-coded fallback sidebar or multiple sidebars-- but that is the basic started pack.

formatting posts in wordpress

I'm developing a wordpress theme, but I'm stuck in formatting the single.php.
I have in my posts a slideshow plugin which is load with the_content() function, togheter with the text of the post, and with the_title() load the title.
that seen like this:
<h1>the_title()</h1>
<div id=post>the_content</div>
the problem is, I need customize how it's display.
I need display:
<div>theplugin</div>
<div id=post>
<span>the_title</span>
the text
</div>
I try to do that with add_filters but I wasn't lucky.
I hope you can understand my explanation, if you need more details, just tell me.
Thanks in advanced.
If users can add plugin components to posts in the editor, they are usually added via shortcodes.
If that's the case with your plugin, you can add it with apply_filters(). Here's an example of how to add a slideshow from the popular nextgen gallery plugin outside the post content:
<?php
$slideshow = apply_filters('the_content', '[slideshow id=1]' );
echo $slideshow;
?>
The above code can be added into single.php, any static page's page template file or directly into header.php to display on all pages.
If you specify the plugin you're using, I'll update the answer accordingly.
If it should indeed be called directly via a function, I second Ancide's answer.
You just need to change the place of where the functions are situated. Like this:
<div>theplugin</div>
<div id=post>
<span><?php the_title(); ?></span>
<?php the_content(); ?>
</div>
Edit: I misunderstood the description of the problem. Here's my answer now that I understand what the problem is:
The plugin uses a hook for the_content function. If you look inside all the php-files inside wp-content/plugins/your-plugin there will be a file with this code:
add_action('the_content','some-function-name');
This tells wordpress to run the function some-function-name everytime the function the_content is run. So you need to look for the some-function-name to figure out how to customize the output.