Tagged: widgets
- This topic has 5 replies, 2 voices, and was last updated 7 years, 8 months ago by
Steve.
-
AuthorPosts
-
-
June 6, 2014 at 1:19 pm #1805
s1r0nMemberI am trying to create a widget. I seem to be able to do that however under the “available widgets” screen, the plugin widget appears as a blank box. I have the following code in the
global-scholar-article.php file
<?php /* Title: Global Scholar Article Description: Output article information, social links, etc. */ ?> <?php echo $before_widget; ?> <?php echo $before_title; ?> <?php echo $after_title; ?> <?php echo 'Put some stuff here'; ?> <?php echo $after_widget; ?> -
June 6, 2014 at 8:05 pm #1806
SteveKeymasterThis code sample looks like a Widget OUTPUT file. It looks like you have a Widget SETTINGS file saved as well that is causing the widget to display that field. You can learn more about Widgets here >
-
June 7, 2014 at 6:10 pm #1808
s1r0nMemberya. i read that. something is not right though. As you can see in the screenshot the widget itself is just a blank box. When I add the widget to a sidebar I get a dropdown to select the widget. when I add and save, the widget does not provide any output, even though it probably should, I think.
here is the code for global-scholar-article-form.php
<?php /* Title: Global Scholar Article Widget Description: Output article information, social links, etc. */ piklist('field', array( 'type' => 'text' ,'field' => 'article_widget_title' ,'label' => 'Title' ,'description' => 'Title' ,'value' => 'Global Scholar' ,'attributes' => array( 'class' => 'text' ) )); ?>and here is the code for global-scholar-article.php
<?php /* Title: Global Scholar Article Widget Description: Output article information, social links, etc. */ ?> <?php echo $before_widget; ?> <?php echo $before_title; ?> <?php echo $after_title; ?> <?php echo 'Put some stuff here'; ?> <?php echo $after_widget; ?> -
June 8, 2014 at 1:28 pm #1809
SteveKeymasterYou are outputting “put some stuff here”. Replace it with
<?php echo $settings['article_widget_title']; ?> -
June 8, 2014 at 6:00 pm #1810
s1r0nMemberStill get nothing. nothing it getting output. and the title and description of the widget are not showing up 🙁
-
June 9, 2014 at 2:48 pm #1813
SteveKeymaster@s1r0n– This works for me:
FILE: global-scholar-article.php
<?php /* Title: Global Scholar Article Widget Description: Output article information, social links, etc. */ ?> <?php echo $before_widget; ?> <?php echo $before_title; ?> <?php echo $settings['article_widget_title']; ?> <?php echo $after_title; ?> <?php echo $after_widget; ?>
-
-
AuthorPosts
- The topic ‘Widget’ is closed to new replies.