Peter
asked 9 years ago

http://www.gscgambia.com/gsc_ask_questions/
http://www.gscgambia.com/gsc_questions/

I have read a lot of articles but not one is working or it go’s behind my knowledge.
The layout takes the whole page instead a part of it.
What can i do to solve this and where can i manage the laoyt?
Many regards,
Peter
 

Peter Kegels
replied 9 years ago

This is in your information:

This is the page.php form mine site:

// Check and get Sidebar Class
global $sidebar;
$sidebar = get_post_meta($post->ID,’page-option-sidebar-template’,true);
$sidebar_array = gdl_get_sidebar_size( $sidebar );
if( $sidebar == ‘no-sidebar’ ){
get_template_part(‘page’, ‘full’);
}else{
get_template_part(‘page’, ‘normal’);
}
?>


What should i wright in content-start-wrapper.php?

4 Answers
Guru
answered 9 years ago

Dear @Peter,
Please find here for the document guide on how to integrate the style of your DWQA plugin pages
:

DW Question & Answer Plugin

Best regards,

Peter Kegels
replied 9 years ago

It is the answer i have seen before. But ok. I will try again. Many regards, Peter

Guru
answered 9 years ago

Hi @Peter,
You need to find the content wrapper of your theme which will be in your theme folder in a file: Single.php/Page.php
You would have to replicate the content wrapper into your content-start-wrapper.php file. i.e. how your theme would be handling the header, article and entry content div’s and the sidebar
 
 
 

Peter Kegels
replied 9 years ago

This is the only i can find and is is in header.php

// Check and get Sidebar Class
$sidebar = get_post_meta($post->ID,’post-option-sidebar-template’,true);
if( empty($sidebar) ){
global $default_post_sidebar;
$sidebar = $default_post_sidebar;
}
$sidebar_array = gdl_get_sidebar_size( $sidebar );

// Translator words
if( $gdl_admin_translator == ‘enable’ ){
$translator_about_author = get_option(THEME_SHORT_NAME.’_translator_about_author’, ‘About the Author’);
$translator_social_share = get_option(THEME_SHORT_NAME.’_translator_social_shares’, ‘Social Share’);
}else{
$translator_about_author = __(‘About the Author’,’gdl_front_end’);
$translator_social_share = __(‘Social Share’,’gdl_front_end’);
}
?>

“>
global $left_sidebar, $right_sidebar, $default_post_left_sidebar, $default_post_right_sidebar;
$left_sidebar = get_post_meta( $post->ID , “post-option-choose-left-sidebar”, true);
$right_sidebar = get_post_meta( $post->ID , “post-option-choose-right-sidebar”, true);
if( empty( $left_sidebar )){ $left_sidebar = $default_post_left_sidebar; }
if( empty( $right_sidebar )){ $right_sidebar = $default_post_right_sidebar; }

global $blog_single_size, $sidebar_type;
$item_size = $blog_single_size[$sidebar_type];

// starting the content
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;
echo ‘

‘;
if ( have_posts() ){
while (have_posts()){
the_post();

// blog thumbnail
print_single_blog_thumbnail( get_the_ID(), $item_size );

echo ‘

‘;

// blog title
echo ‘

‘ . get_the_title() . ‘

‘;

// blog information
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;
comments_popup_link( __(‘0 Comment’,’gdl_front_end’),
__(‘1 Comment’,’gdl_front_end’),
__(‘% Comments’,’gdl_front_end’), ”,
__(‘Comment are off’,’gdl_front_end’) );
echo ‘

‘;

echo ‘

‘;
echo the_author_posts_link();
echo ‘

‘;

$tags_opening = ‘

‘;
$tags_ending = ‘

‘;
the_tags( $tags_opening, ‘, ‘, $tags_ending );

echo ‘

‘;
echo ‘

‘; // blog information

// blog content
echo ‘

‘;
the_content();
wp_link_pages( array( ‘before’ => ‘

‘ ) );
echo ‘

‘;
echo ‘

‘;

// About Author
if(get_post_meta($post->ID, ‘post-option-author-info-enabled’, true) != “No”){
echo “

“;
echo “

” . get_avatar( get_the_author_meta(‘ID’), 90 ) . “

“;
echo “

“;
echo “

” . $translator_about_author . “

“;
echo get_the_author_meta(‘description’);
echo “

“;
echo “

“;
echo “

“;
}

// Include Social Shares
if(get_post_meta($post->ID, ‘post-option-social-enabled’, true) != “No”){
echo “

‘;
include_social_shares();
echo “

“;
}

echo ‘

‘;
comments_template();
echo ‘

‘;

echo ‘

‘; // blog content wrapper
}
}
echo “

“; // end of gdl-page-item

get_sidebar(‘left’);
echo ‘

‘;
echo “

“; // row
echo “

“; // gdl-page-left

get_sidebar(‘right’);
echo ‘

‘;
echo “

“; // row
?>


Guru
replied 9 years ago

Hi Peter

Please place the code below in your content-start-wrapper.php file

// Check and get Sidebar Class
$sidebar = get_post_meta($post->ID,’post-option-sidebar-template’,true);
if( empty($sidebar) ){
global $default_post_sidebar;
$sidebar = $default_post_sidebar;
}
$sidebar_array = gdl_get_sidebar_size( $sidebar );

// Translator words
if( $gdl_admin_translator == ‘enable’ ){
$translator_about_author = get_option(THEME_SHORT_NAME.’_translator_about_author’, ‘About the Author’);
$translator_social_share = get_option(THEME_SHORT_NAME.’_translator_social_shares’, ‘Social Share’);
}else{
$translator_about_author = __(‘About the Author’,’gdl_front_end’);
$translator_social_share = __(‘Social Share’,’gdl_front_end’);
}
?>

“>
global $left_sidebar, $right_sidebar, $default_post_left_sidebar, $default_post_right_sidebar;
$left_sidebar = get_post_meta( $post->ID , “post-option-choose-left-sidebar”, true);
$right_sidebar = get_post_meta( $post->ID , “post-option-choose-right-sidebar”, true);
if( empty( $left_sidebar )){ $left_sidebar = $default_post_left_sidebar; }
if( empty( $right_sidebar )){ $right_sidebar = $default_post_right_sidebar; }

global $blog_single_size, $sidebar_type;
$item_size = $blog_single_size[$sidebar_type];

// starting the content
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;
echo ‘

‘;

echo ‘

‘;

// blog title
echo ‘

‘ . get_the_title() . ‘

‘;

// blog information
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;

echo ‘

‘;
echo the_author_posts_link();
echo ‘

‘;

$tags_opening = ‘

‘;
$tags_ending = ‘

‘;
the_tags( $tags_opening, ‘, ‘, $tags_ending );

echo ‘

‘;
echo ‘

‘; // blog information

// blog content
echo ‘

‘;

——————————————–

and the following in your content-end-wrapper.php file

——————————————-

echo ‘

‘;
echo ‘

‘;

// About Author
if(get_post_meta($post->ID, ‘post-option-author-info-enabled’, true) != “No”){
echo “

“;
echo “

” . get_avatar( get_the_author_meta(‘ID’), 90 ) . “

“;
echo “

“;
echo “

” . $translator_about_author . “

“;
echo get_the_author_meta(‘description’);
echo “

“;
echo “

“;
echo “

“;
}

// Include Social Shares
if(get_post_meta($post->ID, ‘post-option-social-enabled’, true) != “No”){
echo “

‘;
include_social_shares();
echo “

“;
}

echo ‘

‘;
comments_template();
echo ‘

‘;

echo ‘

‘; // blog content wrapper
echo “

“; // end of gdl-page-item

get_sidebar(‘left’);

echo ‘

‘;
echo “

“; // row
echo “

“; // gdl-page-left

get_sidebar(‘right’);
echo ‘

‘;
echo “

“; // row
?>



—————————

And advise if its working for you|

Peter
answered 9 years ago

The only thing now is different error messages.
On the top of my page:
/* load style for DW Q&A plugin */ if( !function_exists(‘dwqa_tourpackage-v1-02_scripts’) ){ function dwqa_tourpackage-v1-02_scripts(){ wp_enqueue_style( ‘dw-tourpackage-v1-02-qa’, get_stylesheet_directory_uri() . ‘/dwqa-templates/style.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘dwqa_tourpackage-v1-02_scripts’ ); }

On the Question page:
Parse error: syntax error, unexpected T_DEC in /usr/local/www/prostorage/kegelspeter815/gscgambiacom/wp-content/themes/tourpackage-v1-02/dwqa-templates/content-start-wrapper.php on line 69

But. It is ok. I think it will not work with my theme. I have to look for another solution and delete this plugin.
Your service was very well and if i need another template, it will be one of yours.
Many regards,
Peter

Guru
replied 9 years ago

Did you create the style.css file as per the documentation?

http://cmspioneer.com/designwall/guide/dw-question-answer-plugin/#Style_integration

Please add: ?> to the end of your content-start-wrapper.php file and see.

Guru
replied 9 years ago

And please add

Peter Kegels
replied 9 years ago

Done.
This is the code i put in my function.php file:

/* load style for DW Q&A plugin */
if( !function_exists(‘dwqa_tourpackage-v1-02_scripts’) ){
function dwqa_tourpackage-v1-02-scripts(){
wp_enqueue_style( ‘dw-tourpackage-v1-02-qa’, get_stylesheet_directory_uri() . ‘/dwqa-templates/style.css’ );
}
add_action( ‘wp_enqueue_scripts’, ‘dwqa_tourpackage-v1-02_scripts’ );
}

where ‘tourpackage-v1-02’ is the name of the direcotry of the theme.

And this is the error message i have on the top of all my pages:

/* load style for DW Q&A plugin */ if( !function_exists(‘dwqa_tourpackage_scripts’) ){ function dwqa_tourpackage-scripts(){ wp_enqueue_style( ‘dw-tourpackage-qa’, get_stylesheet_directory_uri() . ‘/dwqa-templates/style.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘dwqa_tourpackage_scripts’ ); }

Guru
replied 9 years ago

Also the code you added to your functions.php file needs to be with the php start and end tags

/* load style for DW Q&A plugin */ if( !function_exists(‘dwqa_tourpackage_scripts’) ){ function dwqa_tourpackage-scripts(){ wp_enqueue_style( ‘dw-tourpackage-qa’, get_stylesheet_directory_uri() . ‘/dwqa-templates/style.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘dwqa_tourpackage_scripts’ ); }
?>

Peter Kegels
replied 9 years ago

I did it. But now i cannot enter my site agian.
This is what i see ont the whole screen:

Parse error: syntax error, unexpected ‘-‘, expecting ‘(‘ in /usr/local/www/prostorage/kegelspeter815/gscgambiacom/wp-content/themes/tourpackage-v1-02/functions.php on line 162

This is to dangerous. I have working for 4 months on the site and i am very afraid now that this plugin will crash it all. To difficult for me. Your service is really good. But sorry. I need to find another solution.
Many thanks. Peter

I hope to find out all the changes and restore them back to the originals.

Guru
replied 9 years ago

There is ‘-‘ instead of ‘_’ so use the following

/* load style for DW Q&A plugin */ if( !function_exists(‘dwqa_tourpackage_scripts’) ){ function dwqa_tourpackage_scripts(){ wp_enqueue_style( ‘dw-tourpackage-qa’, get_stylesheet_directory_uri() . ‘/dwqa-templates/style.css’ ); } add_action( ‘wp_enqueue_scripts’, ‘dwqa_tourpackage_scripts’ ); }
?>

Guru
replied 9 years ago

Also kindly remove the following from your content-start-wrapper.php

get_sidebar(‘left’);

echo ‘

‘;
echo ““; // row
echo ““; // gdl-page-left

get_sidebar(‘right’);
echo ‘

‘;
echo ““; // row

and place it within the content-end-wrapper.php file

Guru
replied 9 years ago

For the file not found errors, try re-saving your permanent links!

Peter Kegels
replied 9 years ago

That code was already in the content-end-wrapper.php file

Peter Kegels
replied 9 years ago

Ok. It is working. The only thing now is that i have everyware the author information and a Post reply function. Things i need only on those posts i like to have it.
Take a look to your plugin:
http://www.gscgambia.com/gsc_questions/
http://www.gscgambia.com/gsc_ask_questions/

The visitors will fill in many times the wrong box.

Can we remove that?

Guru
replied 9 years ago

Sure,

Simply remove the following from your content-end-wrapper.php file

// About Author
if(get_post_meta($post->ID, ‘post-option-author-info-enabled’, true) != “No”){
echo “

“;
echo “

” . get_avatar( get_the_author_meta(‘ID’), 90 ) . “

“;
echo “

“;
echo “

” . $translator_about_author . “

“;
echo get_the_author_meta(‘description’);
echo “

“;
echo “

“;
echo “

“;
}

// Include Social Shares
if(get_post_meta($post->ID, ‘post-option-social-enabled’, true) != “No”){
echo “

‘;
include_social_shares();
echo “

“;
}

echo ‘

‘;
comments_template();
echo ‘

‘;

Peter Kegels
replied 9 years ago

I think it will work.
Take a look at:

Guru
replied 9 years ago

That is part of your blog plugins, you will have to disable the comment plugin, I would leave it as it is

Peter Kegels
replied 9 years ago

Ok. Thx. Case Closed? Thanks for the great support.

Peter Kegels
replied 9 years ago

But what left are the sidebars. They will not appear.

DominicStaff
answered 9 years ago

Hello Peter !
To display the sidebar in the Question page, Please send me the code that you added to the 2 file:  content-start-wrapper.php / content-end-wrapper.php.
 

Peter Kegels
replied 9 years ago

I have only -Standard template- there

Powered by DW Question & Answer Pro