I'm trying to use the Wordpress page.ly MultiEdit plugin here:
http://wordpress.org/extend/plugins/pagely-multiedit/
I can't get it to work correctly. I get an error:
Bottom, Left, Bottom, Left region(s) are not declared in the template.
Here's a screenshot.
Here is the code for the template file I created:
<?php
/*
Template Name: Home
MultiEdit: Right
*/
?>
<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="content">
<?php the_content(); ?>
</div>
<div class="sidecontent">
<?php multieditDisplay(‘Right’); ?>
</div>
<?php endwhile; endif; ?>
<?php get_footer(); ?>
Am I missing something?
Thanks.
I guess I didn't look at your code close enough. You're not calling them twice in the code, you're just not calling them at all. You can still follow the instructions in my answer and it will work.
Couple things here. It looks like you're calling the same two content blocks twice in the same page template. You can't do that. Each one has to have its own unique name. If you're simply trying to get "bottom', "left", and "right" you need to change you're comment code at the top of the page template.
Use this:
/*
Template Name: Home
MultiEdit: Bottom,Left,Right
*/
Then place these where you want the content to be displayed in your page template:
<?php multieditDisplay('Bottom'); ?>
<?php multieditDisplay('Left'); ?>
<?php multieditDisplay('Right'); ?>
Before you do any of that though, click on the "Screen Options" tab in the top corner of the admin page for your home page editor. Then click on the "Custom Fields" option. Then scroll down until you see the "Custom Fields" area and expand it. Then click on the "Show/Hide Multiedit Fields" so that you can see the ones you currently have in there. You need to delete each one of them to clear them from your editor. Follow these instructions and it will work, its an amazing plugin that I've used many times with great success. Once you fix it, please accept my answer. Let me know if you have any other issues with it.
Also, you don't need to use the call inside of a loop, just drop in the one of the three calls where you need it to be in the template. In fact, I'd recommend not using it inside of a loop.
Related
I have used a wordpress plugin (Add Featured Image Custom Link) to insert custom url to the featured image.
I have two functionalities in my portfolio:
when the user click on image it will popup the image; this is working properly.
the anchor tag I have used for the link which I have added to featured image I want to redirect to the website of which I have added the link on featured image
How do I do #2
<div class="option inner">
<div>
<h5><?php the_title(); ?></h5>
<?php
$url = get_the_post_thumbnail_url(get_the_ID(),'full');
?>
</div>
</div>
If you want to get the input from the (Add Featured Image Custom Link) WordPress Plugin it's easy. This code will add the link if the input is not empty.
<div class="option inner">
<div>
<h5><?php the_title(); ?></h5>
<?php
$cust_li_fi_value = get_post_meta( $post->ID, '_custom_url_image', true );
if( $cust_li_fi_value ) { ?>
<?php }
?>
</div>
</div>
Cheers,
Happy Coding :)
I got my solution by one way i think it is not the proper way
that is, inplace of i wrote the funciton the_content
and inside editor of the wordpress i use the custome html like this
I am trying to add multiple lines of code in a custom html page template between a shortcode that would restrict the content .
The short-code is:
<?php echo do_shortcode("[wcm_restrict plans="gold, platinum"]Restricted Content[/wcm_restrict]"); ?>
I have tried placing the code in the shortcode like below but with no luck:
<?php echo do_shortcode("[wcm_restrict plans="gold, platinum"]"); ?>
<h1>This is a Heading for demo display</h1>
<p>This is a demo paragraph.</p>
<?php echo do_shortcode("[/wcm_restrict]"); ?>
What would the correct way be for placing multiple lines of code between the shortcode?
<?php echo do_shortcode("[wcm_restrict plans="gold, platinum"]Multiple lines of code here[/wcm_restrict]"); ?>
The issue with your first approach is that your content is outside the shortcode and you're inserting two shortcodes.
Try something like this and let us know:
<?php
$content = '[wcm_restrict plans=\"gold, platinum\"]
<h1>This is a Heading for demo display</h1>
<p>This is a demo paragraph.</p>[/wcm_restrict]';
echo do_shortcode("$content"); ?>
EDIT: As pointed out by rick the double quotes need to be escaped. The answer has been updated to reflect that change.
I have integrated HTML Template to wordpress theme. Now, for search box I dont want value attribute to be displayed. But by default wordpress`s search box displays with that value attribute.
My search box(Wordpress) coding is like below. It is in header.php file
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div id="widget-area" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- .widget-area -->
<?php endif; ?>
From above coding the search box is generated with that value attribute. How to make it blank with external css. Thanks in advance.
I have a small question. I have included a wordpress blog on my magento shop via the fishpig module. This works great but what I want to include are header options via static cms blocks on the blog. I think I need to adjust something in the phtml of the homepage blog.
app/design/frontend/base/default/template/wordpress/homepage.phtml
This is the current code:
<div class="page-title blog-title <?php if (!$this->isFirstPage()): ?>not-<?php endif; ?>first-page<?php if ($this->isFirstPage() && $this->getTagLine()): ?> with-tagline<?php endif; ?>">
<h1><?php echo $this->escapeHtml($this->getBlogTitle()) ?></h1>
</div>
<?php if ($this->isFirstPage() && $this->getTagLine()): ?>
<p class="blog-desc blog-tag-line"><?php echo $this->escapeHtml($this->getTagLine())
?></p>
<?php endif; ?>
<div class="blog-home">
<?php echo $this->getPostListHtml() ?>
</div>
I played arount with the following line of code but I cant get it to work:
echo $this->getLayout()->createBlock('cms/block')->setBlockId('example_block')->toHTML();
Any solution would be great!!
Thanks..
You can display static blocks on the blog page using this code
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('example_block')->toHTML();?>
But first you need to create a static block in the admin panel. Admin-> Cms-> Static blocks. Then, after you have specified for the static block title, identifier, status and content, you'll need to replace the block identifier in your code to the identifier of the block that you created in the admin.
For example, you have created a block with identifier "blog_header" means the code to show this block on frontend, will be the
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('blog_header')->toHTML();?>
If you use a sidebar in wordpress, you can put things such as a navigation menu in them.
To place the sidebar in the right container element, you simply call <?php get_sidebar(); ?> within that element, and the sidebar should be placed inside that.
For example, the following code should result in a sidebar within your wordpress footer:
<footer class="footer">
<div id="inner-footer">
<div id="main-content-footer" class="span_16">
<?php get_sidebar(); ?>
</div>
</div>
</footer>
This code will work on pages not integrated with WooCommerce, such as a front page.
On pages with WooCommerce, the code generated by <?php get_sidebar(); ?> will appear outside the footer in the div element #inner-content, which is within the a parent div called #content.
What files are responsible for placing the sidebar code properly in woocommerce? Is it possible that WooCommerce is generating it's own <?php get_sidebar(); ?>? If so, what can I do to make sure my navigation side bar is not affected by WooCommerce?
Thank you all
Seems like this problem has to do with WooCommerce hooks and how their content is wrapped vs. how "normal" themes are laid out.
The simple fix is to use woocommerce_content() to designate your own template for WooCommerce pages. See documentation here:
http://wcdocs.woothemes.com/codex/third-party-custom-theme-compatibility/
Another way to fix this would be to override their sidebar.php file with your own. Documentation here: http://wcdocs.woothemes.com/codex/template-structure/
Make a copy of the simgle-product.php file in your theme directory (same level as functions.php). This is the template for the single product pages. Remove all necessary hooks, including the sidebar hook. Then, refer to this forum: http://phponlinesupport.com/woocommerce-sidebar-t157932.html to finish the job of making your own custom sidebar for just the shop pages.
Note: When creating the sidebar-shop.php file, be sure to include a
Good luck.
This works for me. This code snipet removes WooCommerce sidebar from appearing after #primary block, so you are able to use get_sidebar('shop') in your layouts.
<?php
// in your themes functions.php
/* remove sidebar */
function woocommerce_remove_sidebar_shop() {
if( is_woocommerce() )
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
}
add_action( 'template_redirect', 'woocommerce_remove_sidebar_shop' );
?>