Woocommece - how to change the layout of shortcode template - woocommerce

I am using this shortcode to show all products of a specific product category on custom a template.
[products limit="12" columns="3"]
Now, as I am developing a new theme so the output of this shortcode is breaking the design.
I want to know where or which file I should take or edit to change the layout I want?
Check this image:
Here you can see the rectangle box div's is coming from the content-product.php page but I want to add/change few div before that div's
Like where the <div class="row"> and <div class="woocommerce columns-3 "> is coming? I want to change it.

Related

Wordpress post background by category

I run wordpress website and have custom background skin. For some category's i need custom skin so i use this category-id and add this code:
.skin{
display:none;
}
and after that add my
<div class="custom-category-skin"><img src=""></div>
all that works perfect. Now i need the posts in category with custom skin load the skin from the category.How can i do something like that?

ACF shortcode for inline css using content editor in wordpress

So this seems to not work on wordpress, any reason why this might be happening, I am using Advanced Custom Fields plugin and every custom field shortcode I have used in my content editor which is executed using the_content(); is working perfectly fine. even shortcodes in <a href=""> tags.
But for some reason this one gets ignored, if I take it out of the style="" and test it, I get the image URL value, but in the background-image: attribute I get no value.
<header class="docs-main" style="background-image: url('[acf field='header-background-image']');">
</header>

How do I change the thumbnail size of a fotorama slider?

I've been using the Fotorama plugin to create a slider on my website. It works as it should, but I want to change the size of the thumbnails that are shown, and I can't figure out how. The website is: http://jeannebard.ch/?p=123.
See the full list of options for fotorama here: http://fotorama.io/customize/options/
Options can be passed via data attributes:
<div class="fotorama"
data-thumbwidth="120"
data-thumbheight="120">
<img src="1.jpg">
<img src="2.jpg">
</div>
...or JavaScript:
$('.fotorama').fotorama({
thumbwidth: '120',
thumbheight: '120'
});
...or the Shortcode if using the plugin version:
[gallery ids="1,2,3" nav="thumbs" thumbwidth="120" thumbheight="120"]
This example would set the thumbnails twice their current size, to 120x120.
You can change the default thumbnail size via the WordPress admin area.
Go to: Settings > Media
Update: The Fotorama plugin doesn't seem to use the WordPress media settings. See here instead for an alternative answer.

How do I create different editable sections within a WordPress page?

I have been building my first theme on WordPress and have run into problem while adding content into different sections.
My HTML is somewhat like this,
<div id="maintext">
<-- Text -->
</div>
<div id="products">
<-- Text and Images -->
</div>
<div id="about_company">
<-- Text boxes -->
</div>
How do I make sure the content added via the WordPress editor falls under the respective divs ? For the "maintext" div I'll load the content from the page itself but how do I add content to the other 2 divs dynamically ?
I searched on a couple of forums and many suggested to add content using widgets, is there any way it can be done without using widgets ?
Any help will be gladly appreciated.
Unfortunately adding multiple editable fields in a single page is not particularly easy using WordPress by itself.
Many WP devs I know (myself included) rely on the Advanced Custom Fields Plugin for additional content fields.
The steps to make this happen:
1) Install the ACF the plug.
2) In the settings area for ACF create some new fields.
3) Assign the new fields to appear for a specific page or set of pages.
4) Update your page-template for the given page(s) so that the new fields are displayed.
For instance you might create a set of standard wysiwyg fields and then assign them to the 'overview' page. Let's call these fields: main_text, products_info and about_company. Once the fields have been created and assigned to a page, when you edit that page the additional fields will be available to edit.
For these new fields to be seen by visitors, they must be added to the page-template you use for your overview page. The code could be something like this:
<div id="maintext">
<!-- Text -->
<?php if(get_field('main_text')){ //if the field is not empty
echo '<p>' . get_field('main_text') . '</p>'; //display it
} ?>
</div>
<div id="products">
<!-- Text and Images -->
<?php if(get_field('products_info')){ //if the field is not empty
echo '<p>' . get_field('products_info') . '</p>'; //display it
} ?>
</div>
<div id="about_company">
<!-- Text boxes -->
<?php if(get_field('about_company')){ //if the field is not empty
echo '<p>' . get_field('about_company') . '</p>'; //display it
} ?>
</div>
There are lots of good examples here. If you are feeling really ambitious, rather than install the plugin you could even include ACF directly in your theme.
You've got three options I believe:
Create a widget area where you can then display the content in a text widget: http://codex.wordpress.org/Function_Reference/register_sidebar
Create a template where you then get the content of a different page: http://codex.wordpress.org/Page_Templates#File_Folders
Create a new meta box for all your pages: http://codex.wordpress.org/Function_Reference/add_meta_box
I believe that the thing you are looking for is option 2. The others are more full-site oriented, if you want the extra content to show up on every single page.
If you are writing the theme, maybe you would like to consider using a WordPress Framework so you don't have to start from scratch.
If that is not the case, think of the end user. How will they add sections to pages and posts? Will they have to move across places within the WordPress UI, or would they rather user short codes?
My recommendation is to build a plugin that render the section within the document content. Or widget content if that is the case.
I wrote a little piece of code to illustrate how you can accomplish such a thing, and also because I kind of need it right now :D. You can find it on github here https://github.com/lionpage/Front-Office-Document-Sections
Hope this helps
<div id="maintext">
<?php the_content(); ?>
</div>
<div id="products">
<?php // echo wp function to get product data; ?>
</div>
<div id="about_company">
<?php // echo wp function to get about companydata; ?>
</div>
I've run into this issue several times now, and while the question is 3 years old, I think it's still rather current. I've succesfully used the Multiple Content Blocks plugin sometimes now:
https://ltz.wordpress.org/plugins/multiple-content-blocks/
After installing the plugin, you can just include the_block in your template:
<div id="maintext">
<?php the_content(); ?>
</div>
<div id="products">
<?php the_block('products') ?>
</div>
<div id="about_company">
<?php the_block('company') ?>
</div>
hi im currently developing a theme with that set up.
there are two ways to achieve this:
widgetized and fixed admin panel (customizer options)
i am using the two in my themes
if widgets
create a .php file that includes the widgets sections
create a widget for that section
if fixed in admin panel
you have to include the .php section in your functions.php
edit * advantage of widgetized is you can arrange them just like in a regular sidebar
Was struggling with this, and did not want to use a plugin. The only WordPress native option I found was to use Custom Fields. This works, but only for text, and is rather cumbersome.
The other non-plugin option is to simply use HTML in the WordPress editor, but this is of course far from ideal either.
Finally I gave up, and opted for the Advanced Custom Fields plugin as well.

how to get the wordpress nextgen gallery id

i want to include slide show of images in the WP page.
I have downloaded and installed Nextgen Gallery plugin
from tutorial video i came to know that i have to include the shortcode
[slideshow gallery id="abc" width ="200" height"200"]
now how get the id of already created album?? i.e how i l know the valus "abc"?
in above what is is the id ?
EDIT1
[slideshow galery id="1" width="200" height="200"]
when i write this ..in the webpage the images arnt getting loaded..
when i wwrite [nggallery id=1] in the WP page
The images are getting loaded ..but they arent shown shown as slide show ...
You can find it under the column called ID in your picture, it is a number!
So your code will be
[slideshow galery id="1" width="200" height="200"]
It's right there in your picture under the column labeled "ID". In your example, Gallery 1 has an ID of 1.
And secondly, your shortcode is incorrect. In order to use the NGGallery shortcode, it needs to look something like this:
[nggallery id=1]

Resources