I am working on a magento theme but stuck with adding social links in header.
I just want to put three Social links on to my site in header section of every page.
It will depend on the template your using.
The file you'll need to edit will more than likely be in /APP/DESIGN/Somehwere . The somewhere will depend on you the theme you're using.
To see which file you need to edit, turn on template hints: From your admin panel, go to System >> Configuration >> Developer
Depending on your setup, you may have to set it for your default view or a specific store view.
A quick tutorial of template hints is here : http://www.westwideweb.com/wp/2009/08/04/magento-how-to-turn-on-template-path-hints-and-inline-translation/
The base header template is located in:
/app/design/frontend/base/default/template/page/html/header.phtml
But it's not good practice to directly edit this file, while you can do so.
The proper way would be to make a new theme folder, setup your store to use the right theme within admin then to edit the header.phtml file from that theme, which will override the default base theme - eg:
/app/design/frontend/base/yourtheme/template/page/html/header.phtml
make template path hints on for your store view. System->Configuration->Developer. (You can use your specific IP in allowed IPs not to effect the view)
Disable the cache.
Refresh the home page.
You can view the file there, go to that file.
You can directly add it there or you can create a static block and use that in your phtml file according to your wish.
Related
As you can see in the image, I have a following twig file under the custom theme and I cannot figure out how to display it in the UI (in local host) ideally in front page. Can this be done from the UI or do I need to write a function in my_theme.theme file (it is empty now). If it should be done from the .theme file then what type of function should I write?
More info: I have installed the theme and set it as default already. just want to see at least the <div>testing</div> on the front page.
You can override template of the front page by creating page--front.html.twig file in your theme directory my_theme/templates/. Put some HTML code into it and flush the cache to see the change.
It has been a few years since I properly worked with WordPress. Now I have a proposal to build a WordPress site where every page has a custom design and only some areas of each page is editable.
The reason for this is to build a bespoke layout on each page which cannot be messed up by someone non-technical editing it in the CMS, except for small areas which they can customise.
e.g. A page contains one div which has some text in it, which can be edited in the WP admin backend, but the rest of the page cannot be edited.
Can this be done? How?
Edit: There needs to be multiple editable areas not just one. I know how to make custom pages/templates.
One method may be to create new page templates. Just create a new file in your main theme folder (or the templates folder if there is one). As long at the top of that file contains the line:
/*
Template Name: <your template name>
*/
You can design the page however you want. The data pulled from the admin section will go wherever you invoke
the_content();
The rest of the page can be hardcoded.
Then on the post edit page, on the right side (usually), you can choose the template with your template name for that page. It may be a good idea to copy the current post.php or single.php into your custom file and work from there.
For restricting access you can look at setting up user levels and keep your content contributors as "Authors" instead of "admins" so they can't change themes or edit settings.
(See https://codex.wordpress.org/User_Levels)
For creating specific unique pages with an area that gets changed you should look into custom Page Templates. You can create a page template by dropping a php file with the right naming structure into your theme hierarchy and it will get picked up by the back-end as template option when you create a page.
(See https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/)
I solved this problem using a plugin called Advanced Custom Fields which does exactly what I required.
I don't want to edit the template files - I'd like to make a new template file. I'm looking in the MySQL registry, but all I see is a table for posts, not pages. Someone mentioned the editor earlier, but that doesn't help with creating new templates.
I think I create a php file in my content>theme>my_theme directory, but I'm not certain.
Thanks for any help.
This should help you out:
It shows you which pages map to which template, and how new templates should be created. As an example, if you created an About Us page (singular, static page with the default page template), here's what Wordpress checks for:
Is there a file called page-about-us.php?
No? Is there a page called page-#.php (where # is the pageid)
No? Just render the generic page.php
In your case, if you want to edit a single page (it's a page right, not post?) .. then simply creating a file called page-$slug.php would be sufficient .. WP will use that "template" when rendering that page.
If it's still a bit unclear, check out the source link here (it makes things crystal clear!): http://make.wordpress.org/docs/theme-developer-handbook/part-one-theme-basics/template-hierarchy/
You can create your own template files in your theme directory, or a subfolder. Use a comment on top that has the name of the template.
/*
Template Name: Custom Template
*/
You can assign the template to a page under the "Page Attributes" box in the dashboard.
Of course you need more than just that comment to display anything in your template. You might stay by copying the content of your theme's index.php, then edit from there.
is there any way to include a custom template from a folder inside my plugin page into the Wordpress system so that when I, for example create a new page/post, it can show as one of the template choices other than default of course.
I have seen this link here WP - Use file in plugin directory as custom Page Template? but does not seem to talk about the stage were Wordpress checks for custom templates in the themes directory and how to make it look else where.
It's not in the documentation because WordPress doesn't look elsewhere. Your best bet would be to create a template page in your theme folder, call it what you want, and then use include() to pull the contents of your template file in the plugins directory into the file in your theme directory, which would allow WordPress to see it.
I think the only other way to accomplish this would be to mess with Core, which is very bad practice.
I've made a few modules within my socialengine application however I was wondering how do I add these to the layout editor (root/admin/content) so that I can add widgets to these pages?
You can add the widget in layout editor by adding setting in content.php file.
We recommend adding your widget via the Package Manager which should help take care of the rest. For more information, please see in the Developer SDK section: http://support.socialengine.com/questions/180/Admin-Panel-Manage-Packages-Plugins
You should create a page first from layout editor.DO NOT GIVE any page URL in edit page info section.Leave the page without URL.Most important, add the content widget to your page and save it.
Now, you have a fresh page which does n't have url set.Create a module and either install it or paste it in your application/modules directory. Now, open your database and find the table
"engine4_core_pages" and click on insert and set the name field with your modulename_controller_action.
Comeback to your module and open index controller and put whatever code you want to in index action and just add a simple code to view this in your page,"
$this->_helper->content
// ->setNoRender()
->setEnabled()
You are done.You can set the route from your modules manifest.php inside settings
folder.
Hope this will help.
http://bloffin.blogspot.in/ for more...