order posts on one category by order - php

I already searched for solutions but have no idea where to put PHP code found on this site. No one shows how to edit CSS for the years list. I want to make a certain category to show all posts in gallery mode (grid) and to make it yearly filtered exactly like this one:
items in grid. Please excuse me but I really don't know how to explain it better than showing this example and I really don't want to make an ad or a link to this website. I have not found any other way.

Such things are usually accomplished by the use of an archieves.php file in the root of your wordpress theme directory.
So I would suggest just find this file and edit it to your needs: Edit the code to display it as a grid.
You can add your CSS inline but I would not recommend that. Just place your CSS inside one of the files that come with your theme. Mostly they are placed inside your themes directory in a folder called 'styles' or 'css'. Often theres a file especially for custom user styles. Of course you also can create your own one and reference it inside header.php or even import it in one central CSS file.
Here is a little link (did not look into it but maybe thats useful since you already have the CSS code to display items as grid):
Display all wp-posts

Related

How to edit the WooCommerce shop page

I have copied the WooCommerce files from my plugins file into my theme file so that I can edit / overwrite them. Now I want to be able to find the html files so I can remove certain sections like the search bar and page links in the sidebar. I also need to find the html as I would like to make this plugin work with bootstrap. Which files do I need to find to make these kinds of changes?
I've tried looking and all I can find is php code. Or is this not the way I should be trying to achieve this? Thanks
This is what I'm getting by default as you can see all of my page links are in the sidebar along with a search bar.

How do I insert a field to display above the Content field in WordPress Posts?

I need WordPress Posts to pull a database entity they are not normally supposed to and display the field above the Content output.
Details:
Videos are being uploaded to Vimeo via plugin, which is throwing the iframe code into the database in a convenient and ordered way.
Posts need to display these videos followed by some simple text content.
The Post needs to pull this particular db entry (the iframe) and display it directly above the Content area.
If you could point me to a plugin which manages this, awesome. Otherwise, I'm not sure how to handle this except to change the default method WordPress displays its Posts. While that's not terrible, it's not ideal, as I presume each update would wipe the changes.
This was my question, and I solved it years ago. I am answering it for closure.
Modified PHP files can be preserved by cloning them into the Child Theme.
Copy over WP's single.php to the correct location in your Child Theme (there is copious documentation and a bit of nuance to this process). WP's PHP files are matryoshka dolls, so you may end up copying over a dozen files for one page type.
Read through the files and clone or modify what you need to deliver your final result.
How to pull from the database: Link1 and Link2 will help
Profit

How to edit an opencart footer?

I'm presuming I have to edit the footer through mysql, I haven't done this website, a colleague who has decided not to come back into work has put this together http://tandgwebdesign.co.uk/ashleafarmshop.co.uk/ and it's using the Journal 2 theme, however, usually I would edit the footer through the footer.tpl, or even in the admin panel, however I can't fathom a way of editing the "FREE DELIVERY ON ALL ORDERS OVER £80" and the few lines of text below.
Could anyone help me out and tell me how to edit this through MySQL? It's an OpenCart website, or is there any easier way to do it?
The footer is stored in a file called footer.tpl in the following folder:
catalog/view/theme/YOUR_THEME_NAME/template/common/footer.tpl
Check the footer's <h1> tag and see if you can edit the text there. If there's only a variable there, then I guess it stored in a language file (catalog/language/YOUR_LANGUAGE/common/footer.php).

Wordpress plugin using existing theme

I am building a plugin for the first time and I have setup my rewrite rules to call a PHP file I have located in my plugin folder and this is working but all I have it output just now is "test"
I wanted to ask, is there is a way of pulling in the existing theme and using this as the basis for the page, then I can have my plugin just output the page content area so to speak.
My plugin is quite big in terms of the amount of data it handles so I would like to be able to use a menu link to the aforementioned file and this file can then output all the sub pages of content but still using the default theme (theme I have made) and fill the content area only is this possible and if so is there anything to explain this already available because I couldn't see it.
Any help with this would be much appreciated.
Edit: I have tried including a file from my current theme but this will give me a 500 error so I assume its not as simple as this.
Have you thought about using custom post types for your plugin content rather than relying on custom tables and separate code?
Other than that, you could use a shortcode (just one) and have users insert that into a regular WP page, the shortcode then displays all of your various plugin stuff.
It's hard to be more specific without understanding why you've done it this way.

Magento - Customizing a page?

I just started using Magento, and to me, it seems like a big mess in there...
I'm looking to edit my home page that I got from a template. It looks great but I took out a bunch of useless static blocks inside of it and now I have wholes everywhere. Check the link:
http://goo.gl/v5uTx
What I don't seem to find is where is my actual page structure? I went into the admin and just found this for my home page:
<p>
{{widget type="flexiblewidget/list" column_count="3" limit_count="9"
if="em_feature_product=1" header="Favorite products" order_by="name asc"
template="flexiblewidget/featured.phtml"}}
</p>
Which is basically a tiny part of the page.
So the question is, where can I find the rest of my page content and structure (ie the slideshow, the top offers, ...) so that I can try to re-organise it to look like a website and not cheese?
Thanks.
Magento is different than most other CMS solutions. You may be used to seeing the raw HTML in the CMS page, or at least a good portion of it. However, Magento uses PHP to render blocks onto the page. It gets it's instructions from XML documents inside of your theme. If this is your first time working with Magento, it may be good to check out this post before you get too frustrated. It will walk you through some basics.
Most likely, the HTML for your slider and top offers are in files inside of your theme directory. Your theme directory will be at app/design/frontend/PACKAGE/THEME/ - your php and html will be in the template folder, and the XML instructions will be in the layout folder. The home page, like many other pages on your site are using a main template to load site-wide HTML and CSS. There are 4 of these main templates by default: 1 column, 2 columns with left sidebar, 2 columns with right sidebar, and 3 columns. These main templates can be found in the templates folder under the "page" directory. If you open one of these templates, you will find a line that looks like this:
<?php echo $this->getChildHtml('content') ?>
This line is asking the XML instructions for anything under the block named "content". That is most likely where the slider is being assigned. You will have to find the XML file this is being defined in. You may want to familiarize yourself with the layout folder and Magento's fallback hierarchy. Check out this post.
Hopefully this will help you out with the issues you're having with your page!

Categories