Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter anUser

    (@anuser)

    @joyously ,

    function capacity_template() {
      if( $_GET['post'] === capacity_get_option('service', 'services_page')){
        $services_page = get_post_type_object( 'page' );
        $services_page->template = [[ 'capacity/services', [], [] ]];
        $services_page->template_lock = 'all';
        return false;
      }
      [...]
    
    }
    add_action( 'init', 'capacity_template' );

    the above function does what I wish to do … the problem is solved.

    Thread Starter anUser

    (@anuser)

    @joyously

    in a 1st tempas, the admin chooses the services page (among the existing pages). in a second time, a block that indexes all the pages of services that the admin has created must be inserted on this page that was chosen … I have the impression that you do not understand me… if you have a better idea, you can say, I do not have much experience in creating template or plugin

    • This reply was modified 5 years, 5 months ago by anUser.
    • This reply was modified 5 years, 5 months ago by anUser.
    Thread Starter anUser

    (@anuser)

    @@joyously, the theme is linked to a plugin and custom blocks are built into the plugin.

    Thread Starter anUser

    (@anuser)

    @mattyrob, Thank you for your answer, I am learning redux with react to be able to do that.

    Thread Starter anUser

    (@anuser)

    – Version of WordPress: 4.9.7
    – Error in editing a post in developer console (where you see JS or Jquery error)
    – It s normal post

    <p>load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,sug&load[]=gest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,jquery-ui-position,jquery-ui-menu,wp-a11y,jquery&load[]=-ui-autocomplete,tags-suggest,tags-box,underscore,word-count,post,editor-expand,svg-painter,wp-auth-check,shortcode,backbone,wp-&load[]=util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,media-views,media-editor,media-audiovideo,mce-view,imga&load[]=reaselect,image-edit,editor,wplink,thickbox,media-upload,wp-embed&ver=4.9.7:115 Uncaught TypeError: Cannot read property 'responses' of undefined
        at Object.c [as addAfter] (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,sug&load[]=gest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,jquery-ui-position,jquery-ui-menu,wp-a11y,jquery&load[]=-ui-autocomplete,tags-suggest,tags-box,underscore,word-count,post,editor-expand,svg-painter,wp-auth-check,shortcode,backbone,wp-&load[]=util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,media-views,media-editor,media-audiovideo,mce-view,imga&load[]=reaselect,image-edit,editor,wplink,thickbox,media-upload,wp-embed&ver=4.9.7:115)
        at Object.j.is.d.element.wpAjax.validateForm.d.data.match.d.complete (load-scripts.php?c=0&load[]=hoverIntent,common,admin-bar,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-comments,sug&load[]=gest,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,postbox,jquery-ui-position,jquery-ui-menu,wp-a11y,jquery&load[]=-ui-autocomplete,tags-suggest,tags-box,underscore,word-count,post,editor-expand,svg-painter,wp-auth-check,shortcode,backbone,wp-&load[]=util,wp-backbone,media-models,wp-plupload,wp-mediaelement,wp-api-request,media-views,media-editor,media-audiovideo,mce-view,imga&load[]=reaselect,image-edit,editor,wplink,thickbox,media-upload,wp-embed&ver=4.9.7:10)
        at i (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.7:2)
        at Object.fireWith (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.7:2)
        at y (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.7:4)
        at XMLHttpRequest.c (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=4.9.7:4)</p>
    • This reply was modified 6 years, 7 months ago by anUser.
    • This reply was modified 6 years, 7 months ago by anUser.
    Thread Starter anUser

    (@anuser)

    <?php
    	$args = array('post_type' => 'capacity_portfolio', 'orderby' => 'modified'); 
    	$pages = get_posts( $args );
    	foreach ( $pages as $page ) : setup_postdata( $page ); 
    	
    	echo $page->post_title; 
    	
    	endforeach; 
        wp_reset_postdata();

    The problem is solved…

    Thread Starter anUser

    (@anuser)

    Thank you for your answer. There is no problem with the name of the custom post type. Otherwise, I tried with the post type ‘page’, it works, but when I try with post type ‘post’ or custom post type ‘capacity_service’, I have the same problem …

    I specify that I am in a meta box. I am not on a template (example: page.php).

    • This reply was modified 6 years, 10 months ago by anUser.
    • This reply was modified 6 years, 10 months ago by anUser.
    Thread Starter anUser

    (@anuser)

    @diondesigns, thank you for your answer which is very beneficial. myself experienced $ phpmailer-> Port and $ phpmailer-> SMTPSecure and what you wrote is correct.

    In the question that I asked in my previous message, I wanted to say that it is not obvious for a lambda user (a website designer with wordpress is not necessarily a professional) to find the coordinates STMP …

    ? I also looked to make a plugin ‘SMTP’, I did for gmail and 1and1 … I have more difficulty with outlook for example. But I did not spend a lot of time on ??

    • This reply was modified 7 years ago by anUser.
    Thread Starter anUser

    (@anuser)

    @diondesigns, the code below solves my problem :

    `function init_smtp( $phpmailer ) {
    $phpmailer->isSMTP();
    $phpmailer->Host = ‘smtp.example.com’;
    $phpmailer->SMTPAuth = true;
    $phpmailer->Port = 25; // May need to be changed
    $phpmailer->Username = ‘username’;
    $phpmailer->Password = ‘password’;
    }

    add_action( ‘phpmailer_init’, ‘init_smtp’ );

    However, here it is a template that I build. the user should easily find $ phpmailer-> Host, $ phpmailer-> Username and $ phpmailer-> Password ?

    Thread Starter anUser

    (@anuser)

    @bcworkz, I used the filters ‘wp_mail_from’ and ‘wp_mail_from_name’, it’s cleaner, but it does not change the fact that the mail goes into the pams or is not received.

    Thread Starter anUser

    (@anuser)

    @sterndata, this is a theme that also contains plugin that I created for the running of the theme.

    • This reply was modified 7 years ago by anUser.
    • This reply was modified 7 years ago by anUser.
    Thread Starter anUser

    (@anuser)

    Thank you for your answers, the main reason that pushes me not to use a plugin already realize is that I’m doing a template and I do not want to put in my template plugins made by other people.

    • This reply was modified 7 years ago by anUser.
    • This reply was modified 7 years ago by anUser.
    Thread Starter anUser

    (@anuser)

    Thank you for your answer, I will take into account your answer to make a decision.

    Thread Starter anUser

    (@anuser)

    I waited more than 24 hours, I allow myself to write a new message in order to relaunch the problem, because it is not resolved yet.

Viewing 14 replies - 1 through 14 (of 14 total)