• Resolved devilcerkez

    (@devilcerkez)


    Dear Anmari,

    I am glad you have good plugin. I want to call plugin a specif listing.php You can see codes at here.

    I tried two option. But I could not see widget for my posts (listing)

    <div id="main">
    
    <?php the_post(); ?>
    
    <?php do_action( 'appthemes_notices' ); ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope itemtype="http://schema.org/Organization">
    
    [do_widget "Breadcrumb NavXT"] [do_widget Breadcrumb NavXT]
    	<?php the_listing_image_gallery(); ?>
    
    	<?php appthemes_before_post_title( VA_LISTING_PTYPE ); ?>
    	<h1 class="entry-title" itemprop="name"><?php the_title(); ?></h1>
    
    	<p><?php the_listing_categories(); ?></p>
    	<?php appthemes_after_post_title( VA_LISTING_PTYPE ); ?>
    
    	<?php $website = get_post_meta( get_the_ID(), 'website', true ); ?>
    	<?php $facebook = get_post_meta( get_the_ID(), 'facebook', true ); ?>
    	<?php $twitter = get_post_meta( get_the_ID(), 'twitter', true ); ?>
    
    	<div itemprop="location" itemscope itemtype="http://schema.org/Place">

    https://wordpress.org/plugins/amr-shortcode-any-widget/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author anmari

    (@anmari)

    1) you cannot put a shortcode into html or php code – shortcodes are only understood by wordpress itself in the post content field and in certain other situations.

    2) So you do cannot use this plugin that way

    3) You do NOT need my plugin at all, however you will have to pass any arguments to the widget code your self in your code if you are using anything other than the default.

    Read here:
    http://codex.wordpress.org/Function_Reference/the_widget

    Thread Starter devilcerkez

    (@devilcerkez)

    Thank you for reply anmari,

    But I did not understand custom widget. Can you look at screenshot?

    http://i.hizliresim.com/YPgdmE.png

    <?php the_widget( ‘My_Custom_Widget’, $instance, $args ); ?>

    What I must write for My_Custom_Widget ?

    Thank you sincerely

    Plugin Author anmari

    (@anmari)

    Hi, please read the link:
    http://codex.wordpress.org/Function_Reference/the_widget

    it is not possible for me to teach you wordpress and php via support forum posts. In the link it clearly states how to set up the variables for the function calls.

    for the widget rather obviously you need the class name of the widget you are trying to use.

    Some example, if it can help someone:

    <?php echo do_shortcode(‘[do_widget “bwp recent comments”]’); ?>

    Plugin Author anmari

    (@anmari)

    Actually, stagger lee, if you are coding in php, a more direct way would be NOT to use this plugin at all and rather call the widget directly (you will of course need to pass the arguments to the widget):

    <?php the_widget( $widget, $instance, $args ); ?>

    See

    http://codex.wordpress.org/Function_Reference/the_widget

    Yes man, you are right. As soon i posted i became aware of this, but didnt want to delete comment.
    I was playing with one test development website and had this option, between many others, for what i needed your plugin.

    Your plugin is good to prevent widget showing in all other registered sidebars, footer, etc. Without touching theme files to much. Themes dont have one hidden sidebar where you can hide widget and show it via code in PHP template. It can shows somewhere where you dont want if it as active. Dynamic widget fix that, but with your plugin is easier in those circumstances.

    Or it is maybe better to register whole new sidebar in functions.php and not use it in PHP files anywhere.

    Tell me just one thing bit different from this topic.
    Can one widget be called in PHP template if it is on the list of inactive widgets, but this list that holds all setting at the bottom ?

    I need to test it, but your answer is welcome.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘in a specific post page? listing.php’ is closed to new replies.